tidy -i -asxhtml asset.html > asset.rhtmlThat gets the source ready for modern tools, such as AssertXpath. Then, our tests frequently call assert_tidy, to ensure the XHTML _stays_ tidy, no matter how much refactoring and templating it endures. --PhlIp