Needed to check some XML output from a CalDAV service so I used curl, which is nice and simple. Only problem was that all the XML came on a single long unreadable line. Figured out this was quite simple to fix.
The key part here is of course the piping into xmllint. --format tells it to format the XML and the - tells it to read the XML from standard in. The dash can be swapped with the path to an XML file, if you need to format already downloaded XML.
Simple pimple dimple