.netxmlxmltextwriter

Is XmlTextWriter the fastest way to write out an XML file?


At present I am using XmlTextWriter with WrieStartElement(), WriteAttributeString(), & WriteEndElement(). Is this the fastest way to create an XML file?

Update: I'm looking at XML writers, not raw string writers. Between characters that need to be escaped, handling namespaces, etc. I have no desire to re-invent the wheel. And I doubt I would be any faster after I take all that into account.


Solution

  • And the answer is no (details here). Use XmlWriter instead. The summation of the linked article is "because Microsoft said XmlWriter is replacing XmlTextWriter.