Closes open elements and attributes and sets the XmlTextWriter.WriteState back to the WriteState.Start state.
Type Reason ArgumentException The current instance is in the wrong System.Xml.WriteState, or the document does not have a root element. InvalidOperationException The current instance is in the wrong System.Xml.WriteState, or the document does not have a root element.
This method closes all elements and attributes created by the XmlTextWriter.WriteStartElement(string, string, string) and XmlTextWriter.WriteStartAttribute(string, string, string) methods, respectively, that are open when the XmlTextWriter.WriteEndDocument method is called.
Note:After calling this method, the current instance can be used to write a new XML document.
This method overrides XmlWriter.WriteEndDocument.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0