http://tidy.sourceforge.net/
Google seems to think there is a plugin for that.
http://www.google.com/search?q=xinha+html+tidy
Did you try it? I don't have any experience with it.