if (!contextIsVirtual) contextSet.setSelfAsContext(getExpressionId());
	private Sequence selectByNodeSet(Sequence contextSequence) throws XPathException {		ExtArrayNodeSet result = new ExtArrayNodeSet();		NodeSet contextSet = contextSequence.toNodeSet();		boolean contextIsVirtual = contextSet instanceof VirtualNodeSet;		if (!contextIsVirtual)			contextSet.setSelfAsContext(getExpressionId());		NodeSet nodes =	super.eval(contextSet, null).toNodeSet();				/* if the predicate expression returns results from the cache		 * we can also return the cached result. 		 */		if(cached != null && cached.isValid(contextSequence) && nodes.isCached()) {            if (context.getProfiler().isEnabled())                                     context.getProfiler().message(this, Profiler.OPTIMIZATIONS,                         "Using cached results", result);            return cached.getResult();        }       		DocumentImpl lastDoc = null;      		for (Iterator i = nodes.iterator(); i.hasNext();) {                           NodeProxy currentNode = (NodeProxy) i.next();            int sizeHint = Constants.NO_SIZE_HINT;			if(lastDoc == null || currentNode.getDocument() != lastDoc) {				lastDoc = currentNode.getDocument();				sizeHint = nodes.getSizeHint(lastDoc);			}            ContextItem contextItem = currentNode.getContext();			if (contextItem == null) {				throw new XPathException("Internal evaluation error: context is missing for node " +                        currentNode.getGID() + " !");			}           //TODO : review to consider transverse context			while (contextItem != null) {				if (contextItem.getContextId() == getExpressionId()) {	                NodeProxy next = contextItem.getNode();					if(contextIsVirtual || contextSet.contains(next)) {    						next.addMatches(currentNode);						result.add(next, sizeHint);					}				}				contextItem = contextItem.getNextDirect();			}		}        		if (contextSequence instanceof NodeSet)			cached = new CachedResult((NodeSet)contextSequence, result);        		return result;	}