XPathException is used to indicate an error in an XPath expression.
We don't distinguish compile-time errors from run-time errors because there are
too many overlaps, e.g. constant expressions can be evaluated at compile-time, and
expressions can be optimised either at compile-time or at run-time.