Install the libxml2-utils package. It contains the xmllint program. Pipe the xml data to this program like this
libxml2-utils
xmllint
cat file.xml | xmllint --format -