Otherwise, try HTML Tidy: http://tidy.sourceforge.net/
But, yeah, Tidy does a darn job of turning just about any HTML into XHTML.
The code ended up being something like
QWebView view; view.load("file://local/file/foo.html"); print view.mainFrame()->evaluateJavaScript(javascriptCode);
Full source here: http://github.com/Arora/arora/tree/master/tools/htmlToXBel
With QtWebKit working on all platforms and having a really nice api making things like this is a snap and easy to do.
The architecture of closure-html and cxml are really nice, even if you don't use Lisp. You should take a look.
For one, tables are excess bloat... as your site scales, those small kb turn into big bandwidth savings. Two, code uniformity is important when you have multiple people working on an intensive design and efficiency is critical. XHTML/CSS is practically the new table for new developers entering the market.
And three, as we age we get stuck in our ways. Doesn't surprise me PG may prefer tables. It took me 3 years to wean off of them... but the decision was for the better and I would never go back to tables, except for data display. :)
Have you ever tried printing a thread? It's bearable, not certainly but pretty.
The point being that there is a lot more to development than keystrokes.
But let's user your argument anyway: what's faster:
<div id="content">content</div>
or
<table id="content"><tr><td>content</td></tr></table>
Now, lets say I want to move the table text from left to right alignment. While you're mucking around in your code, I pull up the css file and add a line.
The lack of empirical evidence is due to that non-compliance. The same browser sometimes allows non-compliant code and chokes on valid code. This is a coordination game (just like driving on the right side of the road). If everyone complies (developers, browsers, etc.) things work. If enough don't, everything breaks.
I'm not saying it's impossible to write valid code that works (duh). But having code that validates doesn't exempt you from browser bugs and quirks. And sometimes it makes life quite a bit harder.
An now, they're a nightmare to upgrade.
That the problem is with your coding. Invalid or not, if you can't make it work properly that's down to you and bugger all to do with validity.