private void CopySequence(QilNode nd) {
XmlQueryType typ = nd.XmlType;
bool hasOnEnd;
Label lblOnEnd;
StartWriterLoop(nd, out hasOnEnd, out lblOnEnd);
if (typ.IsSingleton) {
// Always write atomic values via XmlQueryOutput
this.helper.LoadQueryOutput();
// Allow base internal class to dispatch to correct Visit method
base.Visit(nd);
this.iterCurr.EnsureItemStorageType(nd.XmlType, typeof(XPathItem));
}
else {
// Allow base internal class to dispatch to correct Visit method
base.Visit(nd);
this.iterCurr.EnsureItemStorageType(nd.XmlType, typeof(XPathItem));
// Save any stack values in a temporary local
this.iterCurr.EnsureNoStackNoCache("$$$copyTemp");
this.helper.LoadQueryOutput();
}
// Write value to output
this.iterCurr.EnsureStackNoCache();
this.helper.Call(XmlILMethods.WriteItem);
EndWriterLoop(nd, hasOnEnd, lblOnEnd);
}