private void CreateContainerIterator(QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext,
XmlNodeKindFlags kinds, QilName ndName, TriState orSelf) {
// Iterator iter;
LocalBuilder locIter = this.helper.DeclareLocal(iterName, iterType);
Label lblOnEndNested;
QilLoop ndLoop = (QilLoop) ndDod.Child;
Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null);
// iter.Create(filter [, orSelf]);
this.helper.Emit(OpCodes.Ldloca, locIter);
LoadSelectFilter(kinds, ndName);
if (orSelf != TriState.Unknown)
this.helper.LoadBoolean(orSelf == TriState.True);
this.helper.Call(methCreate);
// Generate nested iterator (branch to lblOnEndNested when iteration is complete)
lblOnEndNested = this.helper.DefineLabel();
StartNestedIterator(ndLoop, lblOnEndNested);
StartBinding(ndLoop.Variable);
EndBinding(ndLoop.Variable);
EndNestedIterator(ndLoop.Variable);
this.iterCurr.Storage = this.iterNested.Storage;
GenerateContainerIterator(ndDod, locIter, lblOnEndNested, methNext, typeof(XPathNavigator));
}