Vim is not an island. Sometimes, the best way to do something is an external program.

Assuming the XML is well-formed, this will do:

<C-[>
:%!xmllint --format %