String queryStr = expr.getStringValue();
String queryStr = StringValue.expand(expr.getStringValue());
	public Sequence eval(Sequence[] args, Sequence contextSequence)			throws XPathException {		int argCount = 0;		Sequence exprContext = null;				if (isCalledAs("eval-inline")) {			// the current expression context			exprContext = args[argCount++];		}		// get the query expression        Item expr = args[argCount++].itemAt(0);        Source querySource;        if (Type.subTypeOf(expr.getType(), Type.ANY_URI)) {            querySource = loadQueryFromURI(expr);        } else {            String queryStr = expr.getStringValue();            if ("".equals(queryStr.trim()))              return new EmptySequence();            querySource = new StringSource(expr.getStringValue());        }				NodeValue contextInit = null;		if (isCalledAs("eval-with-context")) {			// set the context initialization param for later use			contextInit = (NodeValue) args[argCount++];		}				// should the compiled query be cached?		boolean cache = false;		if (argCount < getArgumentCount())			cache = ((BooleanValue)args[argCount].itemAt(0)).effectiveBooleanValue();				// save some context properties        context.pushNamespaceContext();		DocumentSet oldDocs = context.getStaticallyKnownDocuments();		if (exprContext != null)			context.setStaticallyKnownDocuments(exprContext.getDocumentSet());				if (context.isProfilingEnabled(2))			context.getProfiler().start(this, "eval: " + expr);				Sequence sequence = null;		XQuery xquery = context.getBroker().getXQueryService();		XQueryPool pool = xquery.getXQueryPool();		CompiledXQuery compiled = cache ? pool.borrowCompiledXQuery(context.getBroker(), querySource) : null;		XQueryContext innerContext;		if (contextInit != null) {			// eval-with-context: initialize a new context			innerContext = xquery.newContext(context.getAccessContext());			initContext(contextInit.getNode(), innerContext);		} else			// use the existing outer context			innerContext = context;		try {			if(compiled == null) {			    compiled = xquery.compile(innerContext, querySource);			} else {				compiled.setContext(innerContext);			}			sequence = xquery.execute(compiled, exprContext, false);            if (innerContext != this.context)                innerContext.reset();			return sequence;		} catch (XPathException e) {			try {				e.prependMessage("Error while evaluating expression: " + querySource.getContent() + ". ");			} catch (IOException e1) {			}			e.setASTNode(getASTNode());			throw e;		} catch (IOException e) {			throw new XPathException(getASTNode(), e.getMessage(), e);		} finally {			if (cache && compiled!=null)				pool.returnCompiledXQuery(querySource, compiled);			if (oldDocs != null)				context.setStaticallyKnownDocuments(oldDocs);			context.popNamespaceContext();			if (context.isProfilingEnabled(2))				context.getProfiler().end(this, "eval: " + expr, sequence);		}	}