APIs and config exports love to hand you XML as one endless line. xmllint sorts that out, and it is already on macOS and available on most Linux distributions.
xmllint --format feed.xml
The indented version is printed to the screen and the original stays untouched. It reads from a pipe when you give - as the name:
curl -s https://example.com/sitemap.xml | xmllint --format -
The other thing I use it for is checking whether a file is well formed at all:
xmllint --noout config.xml
Silence means it parsed. Otherwise you get the line number and the reason, such as an opening and ending tag mismatch, with a marker under the spot, and a non zero exit status. That is far quicker than staring at a settings file that an app refuses to load.
Run the check before you restart a service whose configuration you edited by hand.
Well formed only means the syntax is right. A misspelled element name passes happily, since checking against a schema is a separate job. Don’t redirect the output onto the input file, or you’ll end up with an empty one. And on some Linux systems you need to install the libxml2 utilities first.
Further reading: xmllint manual