Why would you want to output strictly valid HTML in the first place? Any browser is going to treat it with great suspicion anyway, and won't care if it's strictly valid or not, and serving up valid XHTML as text/html works perfectly, except for giving obsessive nerds a headache.