We had a problem in the old contenthandlers that it was html-string based instead of DOM based (it actually accepted both, but automatically transformed back and forth along the way). As a consequence, when you wanted to process a DOM with the contenthandlers, you'd loose the identity of the DOM elements (it didn't handle the DOM that was passed in, but generated a new DOM). This was a bad idea. The contenthandler API should have only accepted a DOM. Transforming back and forth between DOM and html is easy, and can be done before/after the call if necessary. So, if WordTransform.transform() is going to be part of the API (and I think it should be) then it would be better to accept and return a DOM, instead of HTML.