Static html can be checked using a strict HTML parser. However, you could check generated code too, for early validation and debugging. Send it off to the validator and write it out to the socket. Or, use a proxy on the client side, which would be a nice general-purpose tool.
I agree, I hate IE in how it encourages sloppy and incorrect code.