Thank you for your reply.
Html is a permissive syntax which poses many difficulties. In particular, it is very difficult to parse correctly. We develop solutions with a generative approach, where an xhtml page is produced by a series of transformations. An xhtml page can always be post-transformed for a particular customization. We therefore want to have a format that is always parsable to be post-transformed (in environments other than browsers).
Xhtml also has some important flaws, but less so… One day we will perhaps be rid of these old syntaxes full of defects, and a new syntax will emerge like generic-syntax.