code: public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, 
    												PrefixResolver prefixResolver,
    												boolean isTopLevel,
    												int stackFrame,
    												Expression expr )
      throws org.apache.xml.utils.WrappedRuntimeException
    {
      PrefixResolver savedResolver = xctxt.getNamespaceContext();
      XNodeSet result = null;
  
      try
      {
        xctxt.pushCurrentNode(context);
        xctxt.setNamespaceContext(prefixResolver);
  
        // The setRoot operation can take place with a reset operation, 
        // and so we may not be in the context of LocPathIterator#nextNode, 
        // so we have to set up the variable context, execute the expression, 
        // and then restore the variable context.
  
        if (isTopLevel)
        {
          // System.out.println("calling m_expr.execute(getXPathContext())");
          VariableStack vars = xctxt.getVarStack();
  
          // These three statements need to be combined into one operation.
          int savedStart = vars.getStackFrame();
          vars.setStackFrame(stackFrame);
  
          result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt);
          result.setShouldCacheNodes(true);
  
          // These two statements need to be combined into one operation.
          vars.setStackFrame(savedStart);
        }
        else
            result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt);
  
      }
      catch (javax.xml.transform.TransformerException se)
      {
  
        // TODO: Fix...
        throw new org.apache.xml.utils.WrappedRuntimeException(se);
      }
      finally
      {
        xctxt.popCurrentNode();
        xctxt.setNamespaceContext(savedResolver);
      }
      return result;
    }
docs: Execute the expression.  Meant for reuse by other FilterExpr iterators
  that are not derived from this object.