This is a very simple class that can convert the HTML output of a page to XHTML using the Tidy extension.
It starts output buffering using the ob_tidyhandler function as filter to make it regenerate the current script HTML output to make sure it is formatted as XHTML.
The class may set the DTD to one of several possible HTML and XHTML versions.