I'm working on implementing a badly-designed API. I find myself in a spot where I've got a SAX parser for a given document format, and I need to implement a method that's handing me an org.w3c.dom.Element representing the root of a DOM model for that same format.
Without writing a DOM version of the parser, and without bouncing the DOM off the disk as XML (which itself is far trickier than it ought to be --
) is there any relatively simple way, using only API classes, to walk the DOM tree and feed the SAX parser?