//We might not be sure of the return type at this level
Type.subTypeOf(whereExpr.returnsType(), Type.ITEM)) {
final Sequence seq = whereExpr.eval(contextSequence);
//But *now*, we are ;-)
if (Type.subTypeOf(whereExpr.returnsType(), Type.NODE)) {
final NodeSet nodes = seq.toNodeSet();
// if the where expression returns a node set, check the context
// node of each node in the set
final NodeSet contextSet = contextSequence.toNodeSet();
final boolean contextIsVirtual = contextSet instanceof VirtualNodeSet;
final NodeSet result = new ExtArrayNodeSet();