if (contextItem != null) { contextSequence = contextItem.toSequence(); }
	public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {        if (context.getProfiler().isEnabled()) {            context.getProfiler().start(this);                   context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));            if (contextSequence != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);            if (contextItem != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());        }        		// evaluate the expression		context.pushDocumentContext();		Sequence result = super.eval(null, null);		context.popDocumentContext();        		// create the output		MemTreeBuilder builder = context.getDocumentBuilder();		DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);				try {			SequenceIterator i = result.iterate();			Item next = i.nextItem();						StringBuffer buf = null;			while (next != null) {			    context.proceed(this, builder);				// if item is an atomic value, collect the string values of all				// following atomic values and seperate them by a space. 				if (Type.subTypeOf(next.getType(), Type.ATOMIC)) {				    if(buf == null)				        buf = new StringBuffer();					else if (buf.length() > 0)						buf.append(' ');					buf.append(next.getStringValue());					next = i.nextItem();				// if item is a node, flush any collected character data and				//	copy the node to the target doc. 				} else if (Type.subTypeOf(next.getType(), Type.NODE)) {					if (buf != null && buf.length() > 0) {						receiver.characters(buf);						buf.setLength(0);					}					next.copyTo(context.getBroker(), receiver);					next = i.nextItem();				}			}			// flush remaining character data			if (buf != null && buf.length() > 0)				receiver.characters(buf);		} catch (SAXException e) {		    LOG.warn("SAXException during serialization: " + e.getMessage(), e);            throw new XPathException(getASTNode(), e.getMessage());			//throw new XPathException(getASTNode(),			//	"Encountered SAX exception while serializing enclosed expression: "			//		+ ExpressionDumper.dump(this));		}               if (context.getProfiler().isEnabled())                       context.getProfiler().end(this, "", result);                         		return result;	}