XQueryParser parser = new XQueryParser(lexer, false);
XQueryParser parser = new XQueryParser(lexer);
	public Sequence eval(		Sequence contextSequence,		Item contextItem)		throws XPathException {        // get the query expression		String expr = StringValue.expand(			getArgument(0).eval(contextSequence, contextItem).getStringValue()		);        // 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(new StringReader(expr));		XQueryParser parser = new XQueryParser(lexer, false);		// 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());			}			Sequence sequence = path.eval(null, null);			LOG.debug("found " + sequence.getLength());			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);		} catch (XPathException e) {			throw new XPathException("error found while executing expression: " +				e.getMessage(), e);		} finally {			if(oldDocumentSet != null)				context.setStaticallyKnownDocuments(oldDocumentSet);		}	}