Using xmllint to format xml
Long ago I used to use this utility with some frequency to pretty-print xml: xmllint, from the libxml2 project. I mention this here as much to remind myself how to use it as anything else.
$ export XMLLINT_INDENT=" "; xmllint --format foo.xml
where the environment variable XMLLINT_INDENT controls the indentation level. Two spaces are the default.
The utility is available without further ado on later versions of OS X, as well as on a number of Linux distributions, where I suspect it’s almost ubiquitous.