XML: use try/catch with XPath functions