It looks to me as if the saxon:serialize() extension function does what you want. In fact, you are probably trying to replicate it.Hi,
Thanks for the feedback.
I'm doing XML-to-XML transformations with Saxon and the documents contain HTML fragments.
The HTML fragments need to be included in the result documents with HTML tags escaped.
The extension function was written to take an XPath sequence as argument and return it as a string.
HTMLEmitter is used as a receiver in the ComplexContentOutputter.
I'm a novice with Saxon so, if there's a better way to do this any pointers would be appreciated.