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());        }                        Sequence seq;        Sequence result;        Item item; 		if (contextSequence == null || contextSequence.isEmpty()) 			result = Sequence.EMPTY_SEQUENCE;                    		//If we have one argumment, we take it into account		if (getSignature().getArgumentCount() > 0) 			seq = getArgument(0).eval(contextSequence, contextItem);		//Otherwise, we take the context sequence and we iterate over it		else			seq = contextSequence; 				        result = new ExtArrayNodeSet(seq.getLength());		int j = 0;		for (SequenceIterator i = seq.iterate(); i.hasNext(); j++) {			item = i.nextItem();            if (!Type.subTypeOf(item.getType(), Type.NODE))                throw new XPathException("FOTY0011: item is not a node; got '" + item + "'");            NodeProxy p;            if (item instanceof NodeProxy)            	p = (NodeProxy) item;            else            	p = (NodeProxy) item.toSequence().toNodeSet().get(0);			org.exist.dom.DocumentImpl doc = p.getDocument();            //Filter out the temporary nodes wrapper element            //WARNING : currently, we assume that *all* the nodes are wrapped in the same document            if (doc.getCollection().isTempCollection()) {                                        StoredNode trueRoot = (StoredNode)doc.getDocumentElement().getChildNodes().item(j);                result.add(new NodeProxy(trueRoot));            } else            	result.add(new NodeProxy(((NodeProxy) item).getDocument()));		}    	    if (context.getProfiler().isEnabled())	            context.getProfiler().end(this, "", result);                    return result;            }	