This is an old revision of the document!
Download and install Tidy.
For help, do:
To clean up HTML by creating indented code, wrapping text at column #500, converting HTML to XHTML, and modify the existing file in place, do the following:
tidy -i -w 500 -asxml -m <filename>
Make sure to make a backup copy of the file first.