I’ve had to disable so many of the HTML cleanup features in WordPress. I disabled XHTML markup, completely disabled the filtering in posts displays in wp-includes/template-functions-post.php, and just went through and disabled the balanceTags() calls in wp-admin/post.php. Sheesh. WordPress thinks it’s smarter than I am, but I’ve got news for it.

You would be amused at what I’ve done with the post processing script. Take a look at the test site, and then check out the time stamps of the pages. Compare that to the comment block in the source. Hehe.
I even had to install Tidy to change the encoding of the output from Manila!