Using the XmlWriter
The XmlWriter class writes XML data to a stream, file, TextReader, or string. It provides a means of creating well-formed XML data in a forward-only, write-only, non-cached manner. The XmlWriter class supports the W3C XML 1.0 and Namespaces in XML recommendations. This section discusses how to create an XmlWriter instance with a specified set of features, data conformance checking, writing typed data, and so on.