public XObject execute( Node rootNode ) throws Exception {
if (rootNode.getNodeType() == Node.DOCUMENT_NODE) {
rootNode = ((Document)rootNode).getDocumentElement ();
}
this.rootNode = rootNode;
prefixResolver = namespace != null ? new PrefixResolverDefault (namespace):
new PrefixResolverDefault (rootNode);
// execute the XPath query on the specified root node
org.apache.xpath.objects.XObject xobj =
XPathAPI.eval (rootNode, qstring, prefixResolver);