I've had the most luck with this:
:%!xmllint --format %
It's strict about your tags, though, so it will error out if your opening and closing tags don't match. It also adds an XML declaration at the top of your file, if you don't have one as well.
This page recommends the following, although I can't get it to work:
:set filetype=xml
:filetype indent on
gg=G
I tested it out, and it seems to work, somewhat. Not perfectly, but it gets the job done.
If that doesn't work well, you could use minidom in Python to format it for you.
import xml.dom.minidom
xml = xml.dom.minidom.parse(filename)
formatted_xml = xml.toprettyxml()