Collator collator = getCollator(contextSequence);
	protected Sequence quickNodeSetCompare(Sequence contextSequence)		throws XPathException {		// if the context sequence hasn't changed we can return a cached result		if(cached != null && cached.isValid(contextSequence)) {//			LOG.debug("Returning cached result for " + pprint());			return cached.getResult();		}		//	evaluate left expression		NodeSet nodes = (NodeSet) getLeft().eval(contextSequence);				if(nodes.getLength() < 2)			// fall back to nodeSetCompare if we just have to check a single node			return nodeSetCompare(nodes, contextSequence);				// evaluate right expression		Sequence rightSeq = getRight().eval(contextSequence);		if (rightSeq.getLength() > 1)			// fall back to nodeSetCompare			return nodeSetCompare(nodes, contextSequence);				// get the type of a possible index		int indexType = nodes.getIndexType();				DocumentSet docs = nodes.getDocumentSet();		NodeSet result = null;			    if(indexType != Type.ITEM) {	        // we have a range index defined on the nodes in this sequence	        Item key = rightSeq.itemAt(0);	        if(key.getType() != indexType) {	            // index type doesn't match. If index and argument have a numeric type,	            // we convert to the type of the index	            if(Type.subTypeOf(indexType, Type.NUMBER) &&	                    Type.subTypeOf(key.getType(), Type.NUMBER))	                key = key.convertTo(indexType);	        }	        // if key does not implement Indexable, we can't use the index	        if(key instanceof Indexable && Type.subTypeOf(key.getType(), indexType)) {	            LOG.debug("Using value index for key: " + key.getStringValue());	            result = context.getBroker().getValueIndex().find(relation, docs, nodes, (Indexable)key);	        } else	            return nodeSetCompare(nodes, contextSequence);	        	    } else if (relation == Constants.EQ				&& nodes.hasTextIndex()) {	        // we can use the fulltext index	        String cmp = getComparisonString(rightSeq);	        if(cmp.length() < NativeTextEngine.MAX_WORD_LENGTH)	            nodes = useFulltextIndex(cmp, nodes, docs);	        // now compare the input node set to the search expression			Collator collator = getCollator(contextSequence);			result =				context.getBroker().getNodesEqualTo(nodes, docs, relation, cmp, collator);		} else {		    		    // no usable index found. Fall back to nodeSetCompare()		    return nodeSetCompare(nodes, contextSequence);		}				// can this result be cached? Don't cache if the result depends on local variables.		boolean canCache = 		    contextSequence instanceof NodeSet &&	        (getRight().getDependencies() & Dependency.LOCAL_VARS) == 0 &&	        (getLeft().getDependencies() & Dependency.LOCAL_VARS) == 0;		if(canCache)			cached = new CachedResult((NodeSet)contextSequence, result);		return result;	}