I'm using the SyndicationFeed class to generate an Atom feed and an Atom10FeedFormatter to serialize it. I'd like to be able to add line breaks between the elements when the file gets written to disk. I realize the feed readers don't care, but when I run my docs through http://feedvalidator.org/ it treats the whole doc as a single line, which makes it a PITA to see where my mistakes are since every error is on "line 1".
For example, instead of output like this:
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Title For My Feed</title><subtitle type="text">Subtitle for my feed.</subtitle><id>uuid:d2ad3f53-6f1a-4495-ba92-ab3231413f97;id=1</id><updated>2009-05-12T19:42:56Z</updated><author><name>Matt</name>...
I'd like to get output something like this:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">Title For My Feed</title>
<subtitle type="text">Subtitle for my feed.</subtitle>
<id>uuid:d2ad3f53-6f1a-4495-ba92-ab3231413f97;id=1</id>
<updated>2009-05-12T19:42:56Z</updated>
<author>
<name>Matt</name>
...
Here's the code I'm using to serialize, just in case it matters:
XmlWriter atomWriter = XmlWriter.Create(@"atom.xml");
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(TheFeed);
atomFormatter.WriteTo(atomWriter);
atomWriter.Close();