writeStartDocument
WriteStartDocument is a method of the XmlWriter class used to begin an XML document by emitting the XML declaration. It is available in the .NET Framework, .NET Core, and related .NET platforms that implement XmlWriter.
There are two overloads: WriteStartDocument() and WriteStartDocument(bool standalone). The boolean overload writes a standalone attribute into
When invoked, WriteStartDocument causes the writer to emit the XML declaration at the start of the document.
Usage and lifecycle: WriteStartDocument should be called before any other content is written. If it is called
See also: WriteStartElement, WriteEndDocument, XmlWriterSettings, and related XmlWriter methods.