I hate xml.
I really hate it. No humans should have to read it.
As a developer, if I have to even think about Xml, then it is because some developer before me made the wrong choice.*
That said, sometimes a developer full of contempt toward Xml does need to read xml.
Both feedburner and WordPress output mostly well spaces xml, but what if I look at rss from blogs.msdn.com? It looks like the webserver is running a whitespace filter. This is not human readable Xml. Now, I COULD copy and paste into Visual Studio, but then I have to open a new xml document, or save what I’m viewing in the browser and open in Visual Studio. All too many steps.
Cygwin comes with an optional program called xmllint. It is part of the libxml2 package, so be sure to select libxml2 when you run cygwin setup.exe.
$ curl http://blogs.msdn.com/giorgio/rss.xml | xmllint –format – | less
This reformats the xml into a nice 2-space indented by tag display.
* This may be a bit extreme, but I will stand by it most of the time.