SCITE includes TIDY for cleaning up HTML/XML documents (rewrapping lines, cleaning up spacing, etc). If you’ve never used Scintilla based products before (and you have if you’ve used SEPY, FlashDevelop, Scite|Flash) it’s a great text editing library that is wrapped in an application layer (Scite). Try out one of the installers they include — they’re ultra lightweight and really nice to have around.
Information on parameters used by TIDY are noted here. The default values of the cleanup never really worked with how I used the app so I’ve made modifications to the html.properties file in the Scintilla Text Editor folder.