curl and xmllint pipe
more succinct
curl foo.com/somefile.xml | xmllint --format -
Explanation:
Here we are piping the xml from the curl command into the xmllint command. The xmllint man page says
$ man xmllint> ... The xmllint program parses one or more XML files, specified on the command line as XML-FILE (or the standard input if the filename provided is - ).
So that's why we do xmllint --format -
because this particular command will read from stdin if you specify -
as the filename. Sidenote, there's a discussion about the -
arg here. I personally don't like that stdin is not the default but I'm not the author.