Posted on Wednesday September 9, 2009

Format XML in C#

Below is a small snippet showing how to format (or re-format) XML so it’s indented. XML isn’t stored in this humanly readable way in databases (or in System.XML’s various writers), so this method makes the XML easier on the eyes.