protected override QilNode VisitDocumentCtor(QilUnary ndDoc) {
Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer.");
// Generate call to XmlQueryOutput.WriteStartRootChk
this.helper.CallWriteStartRoot();
// Recursively construct content
NestedVisit(ndDoc.Child);
// Generate call to XmlQueryOutput.WriteEndRootChk
this.helper.CallWriteEndRoot();
this.iterCurr.Storage = StorageDescriptor.None();
return ndDoc;
}