Tag Archives: XmlTextWriter

Format an XML file so it looks nice in C#

This example shows how to format an XML file. When the computer processes an XML file, it doesn’t care about formatting. It doesn’t need indentation and new lines to make the file look nice. As long as the file is … Continue reading

Posted in strings, XML | Tagged , , , , , , , , , , | 4 Comments

Build a formatted XML document in memory in C#

This example uses an XmlTextWriter to build a formatted XML document in memory and displays it in a text box. When you click the Go button, the following code executes. private void btnGo_Click(object sender, EventArgs e) { MemoryStream memory_stream = … Continue reading

Posted in XML | Tagged , , , , , , , , , , , , , , | 1 Comment