If the previous method of serving up XHTML with PHP didn't work quite right (or didn't work well with your app), then you might consider checking out this post from Mathibus.com too.
The most obvious one of the many perils of using XHTML properly, is of course the fact that IE cannot handle the application/xhtml+xml MIME type. Unless you don’t mind if your site can’t be visited through that wanna-be–browser, this means that you’ll have to serve up your XHTML pages as application/xhtml+xml where possible, but as text/html to the crappier ones. Stuff like this is called content negotiation.
He actually gives two methods to serve the XHTML - one with PHP, the other via mod_rewrite rules. In the PHP method, he shows a script that, along with support for several validators, transforms the HTML if necessary for output and displays it with the appropriate header info...




