xml: add HTML-specific code in serializer