code: public  XObject eval(
            Node contextNode, String str, PrefixResolver prefixResolver)
              throws TransformerException
    {
  
      // Since we don't have a XML Parser involved here, install some default support
      // for things like namespaces, etc.
      // (Changed from: XPathContext xpathSupport = new XPathContext();
      //    because XPathContext is weak in a number of areas... perhaps
      //    XPathContext should be done away with.)
      // Create the XPath object.
      XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
  
      // Create an XPathContext that doesn't support pushing and popping of
      // variable resolution scopes.  Sufficient for simple XPath 1.0 expressions.
      XPathContext xpathSupport = new XPathContext(false);
  
      // Execute the XPath, and have it return the result
      int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
  
      return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
    }
docs: Evaluate XPath string to an XObject.
  XPath namespace prefixes are resolved from the namespaceNode.
  The implementation of this is a little slow, since it creates
  a number of objects each time it is called.  This could be optimized
  to keep the same objects around, but then thread-safety issues would arise.
  
  @param contextNode The node to start searching from.
  @param str A valid XPath string.
  @param prefixResolver Will be called if the parser encounters namespace
  prefixes, to resolve the prefixes to URLs.
  @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
  @see org.apache.xpath.objects.XObject
  @see org.apache.xpath.objects.XNull
  @see org.apache.xpath.objects.XBoolean
  @see org.apache.xpath.objects.XNumber
  @see org.apache.xpath.objects.XString
  @see org.apache.xpath.objects.XRTreeFrag
  
  @throws TransformerException