if (itemType == Type.NODE) if (item instanceof NodeProxy) itemType = ((NodeProxy)item).getNode().getNodeType();
	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 = expression.eval(contextSequence, contextItem);				for(SequenceIterator i = seq.iterate(); i.hasNext(); ) {			Item item = i.nextItem();			int itemType = item.getType();			//If item type is "unknown", try to get it from the sequence type			//Should we get a kind of Type.UNKNOWN rather than Type.NODE ?			if (itemType == Type.NODE) 				itemType = seq.getItemType();			if(!Type.subTypeOf(itemType, test.getType())) {								throw new XPathException(expression.getASTNode(), "Type error in expression" +					": required type is " + Type.getTypeName(test.getType()) +					"; got: " + Type.getTypeName(item.getType()) + ": " + item.getStringValue());			}			Node node = ((NodeValue) item).getNode();			if(!test.matchesName(node))				throw new XPathException(expression.getASTNode(), "Type error in expression: " +						"required node name is " + test.getName() + "; got: " +						node.getNodeName());		}                if (context.getProfiler().isEnabled())                       context.getProfiler().end(this, "", seq);          		return seq;	}