One of the included utilities in Macromedia's Homesite Editor is Dave Raggett's HTML Tidy (now an open source project). Tidy also ships with a number of other programs; it is also available as a free download.
I love this program. For me, it is a great time saver: it inserts my <!doctype> of choice and formats my HTML to my specifications. I admit it: I like (love!) pretty code!
What some users might not realise is that HTML Tidy can be custom configured. You can even open the .tdy files and edit changes directly.
Here is my custom xhtml.tdy:
/* end example */
I have several, though I tend to use this one most of the time. There are other methods to customize Tidy, but this works best for my usage. I would like to know what your opinions are and what customizations you might use.
Besides formatting code, Tidy also fixes many common, and some not so common, coding errors. I use it well before sending a page to the W3C Validator. Pretty AND useful! What a combination! ;)