I think <title> should be on a separate line in the header.
minor change to indentation. instead of calling the indent-method and then deciding to indent or not, now we check first and then call the method or we don't. (saves the creation of a StringBuilder and one append-operation)
some changes to output nicer HTML code. it's still not perfect, but i think it fails in fewer cases than the previous solution.

the check (subNode instanceof DOMElement) is rather ugly. it is the quick way of doing it. I could have also changed the render-method to return the desired information, but that would have been a bit extensive.