BuiltinTypeRegistry.XS_INTEGER, Quantifier.QUANT_ONE), lastLVar));
LogicalVariable forLVar = newLogicalVariable();
LogicalVariable posLVar = newLogicalVariable();
UnnestOperator unnest = new UnnestOperator(forLVar, mutable(ufce(BuiltinOperators.ITERATE, vre(seqLVar))),
posLVar, BuiltinTypeRegistry.XS_INTEGER, new VXQueryPositionWriter());
SequenceType forVarType = SequenceType.create(AnyItemType.INSTANCE, Quantifier.QUANT_ONE);
XQueryVariable forVar = new XQueryVariable(XMLQueryCompilerConstants.DOT_VAR_NAME, forVarType, forLVar);
tCtx.varScope.registerVariable(forVar);
SequenceType posVarType = SequenceType.create(BuiltinTypeRegistry.XS_INTEGER, Quantifier.QUANT_ONE);
XQueryVariable posVar = new XQueryVariable(XMLQueryCompilerConstants.POS_VAR_NAME, posVarType, posLVar);
tCtx.varScope.registerVariable(posVar);
unnest.getInputs().add(mutable(tCtx.op));
tCtx.op = unnest;
}