Nice try, George, but does your code do right thing with this?
<p><name>Mr Magoo</name> didn't like eating <emph>cabbages</emph>
or <foreign>chou croute</foreign>. Indeed, his pet hates were
as evinced by this exchange:
Mr Magoo: I hate cabbages
(which is usually marked up as
<eg><!CDATA[<sp>I hate cabbages</sp>]]></eg>
if you use TEI).
There, happy now?
I contend that making valid XHTML from the above is non-trivial.
Information Manager, Oxford University Computing Services
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431
OSS Watch: JISC Open Source Advisory Service