code: public XPathExpression compile(String expression)
          throws XPathExpressionException {
          if ( expression == null ) {
              String fmsg = XSLMessages.createXPATHMessage( 
                      XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
                      new Object[] {"XPath expression"} );
              throw new NullPointerException ( fmsg );
          }
          try {
              org.apache.xpath.XPath xpath = new XPath (expression, null,
                      prefixResolver, org.apache.xpath.XPath.SELECT );
              // Can have errorListener
              XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
                      prefixResolver, functionResolver, variableResolver,
                      featureSecureProcessing );
              return ximpl;
          } catch ( javax.xml.transform.TransformerException te ) {
              throw new XPathExpressionException ( te ) ;
          }
      }
docs: <p>Compile an XPath expression for later evaluation.</p>
  
  <p>If <code>expression</code> contains any {@link XPathFunction}s,
  they must be available via the {@link XPathFunctionResolver}.
  An {@link XPathExpressionException} will be thrown if the <code>XPathFunction</code>
  cannot be resovled with the <code>XPathFunctionResolver</code>.</p>
  
  <p>If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.</p>
  
  @param expression The XPath expression.
  
  @return Compiled XPath expression.
  
  @throws XPathExpressionException If <code>expression</code> cannot be compiled.
  @throws NullPointerException If <code>expression</code> is <code>null</code>.