context.popNamespaceContext();
	public Sequence eval(		Sequence contextSequence,		Item contextItem)		throws XPathException {        // get the query expression		String expr = StringValue.expand(getArgument(0).eval(contextSequence, contextItem).getStringValue());		if ("".equals(expr.trim()))		  return new EmptySequence();        // check optional collection argument        DocumentSet oldDocumentSet = null;        if(getArgumentCount() > 1) {        	oldDocumentSet = context.getStaticallyKnownDocuments();        	Sequence collectionArgs = getArgument(1).eval(contextSequence, contextItem);        	if(collectionArgs.getLength() > 0)            	context.setStaticallyKnownDocuments(getCollectionContext(collectionArgs));        }		LOG.debug("eval: " + expr);		XQueryLexer lexer = new XQueryLexer(context, new StringReader(expr));		XQueryParser parser = new XQueryParser(lexer);		// shares the context of the outer expression		XQueryTreeParser astParser = new XQueryTreeParser(context);		try {		    parser.xpath();			if(parser.foundErrors()) {				LOG.debug(parser.getErrorMessage());				throw new XPathException("error found while executing expression: " +					parser.getErrorMessage());			}			AST ast = parser.getAST();						PathExpr path = new PathExpr(context);			astParser.xpath(ast, path);			if(astParser.foundErrors()) {				throw new XPathException("error found while executing expression: " +						astParser.getErrorMessage(), astParser.getLastException());			}			long start = System.currentTimeMillis();			Sequence sequence = path.eval(null, null);			path.reset();			LOG.debug("Found " + sequence.getLength() + " for " + expr);			LOG.debug("Query took " + (System.currentTimeMillis() - start));			return sequence;		} catch (RecognitionException e) {			throw new XPathException("error found while executing expression: " +				e.getMessage(), e);		} catch (TokenStreamException e) {			throw new XPathException("error found while executing expression: " +				e.getMessage(), e);		} finally {			if(oldDocumentSet != null)				context.setStaticallyKnownDocuments(oldDocumentSet);		}	}