How to Pretty Print XML from the Command-line
Here is a nice article How to pretty print XML from the command line? that shows a lot of ways to do that, but I really like the one with Python, as it totally solves a problem I was having.
cat SomeXmlDataFileToPrint.xml | python -c 'import sys;import xml.dom.minidom;s=sys.stdin.read();print(xml.dom.minidom.parseString(s).toprettyxml())'
It will be quite helpful for writing a solution for comparing two XML files (from TeamSite, of course) -- usually one that works (my local) and one that was published through TeamSite. I've had to do this twice now with some tickets, so I'd like to have a general solution handy so I don't have to think about it anymore!
I basically have what is above, in a script file xml_pprint.py
in my bin directory, so I can use it over and over!