To make it easy to process our output using both XML and HTML tools, we should serialize our output to so-called 'polyglot markup'. This means that our output will be valid XML *and* HTML5 at the same time (effectively XHTML).
The spec for polyglot markup is at http://dev.w3.org/html5/html-xhtml-author-guide/. The relevant differences to our current HTML5 serialization should be:
- void elements are serialized with trailing / as in <br/>
- only a small set of named entities is used, other entities are converted to character entities ( becomes  )
We can add either add this functionality in Domino, or create our own XMLserializer implementation that walks an arbitrary DOM.