You can pipe a region to xmllint (if you have it) using:
M-|
Shell command on region: xmllint --format -
The result will end up in a new buffer.
I do this with XML, and it works, though I believe xmllint needs certain other options to work with HTML or other not-perfect XML. nxml-mode will tell you if you have a well-formed document.