rewrite InfosetCursorFromXMLCursor to be InfosetCursorFromXMLStreamReader.
XMLStreamReader is the lowest level interface to XML available. It allocates almost nothing. It is a cursor style interface with next(), hasNext() then provides an integer which is the event type. You only construct a string for the element name if you call getName, etc.
I investigated Scala's scala.xml.pull parser, and it is to be avoided - uses threads underneath. Just what we're trying to get away from.
Then we should drop Infoset.elem2Infoset and related methods and reimplement using the above so we have exactly one thing that reads XML-representations of daffodil infosets.
I found the implementation of XMLStreamReader which is StreamReaderBufferProcessor. This is definitely the lowest level interface to XML, and it's a cursor (i.e., non-allocating) API, so is the right one for us to call.
We have to rewrite this for performance reasons.