Two separate but related problems:
When walking a TinyTree to deliver a sequence of pull events (class TinyTreeEventIterator), no "end element" events are returned at the end of the document; instead the last text node (typically) will be followed immediately by the end document event. This is incorrect, and if the client is a JAXB Unmarshaller, it causes the Unmarshaller code to crash.
If the client of the XMLStreamReader makes repeated calls on next() without calling hasNext(), Saxon responds to the call on next() incorrectly with an AssertionError. The correct response to a call on next() after the stream is exhausted is either an IllegalStateException (on the grounds that the only call allowed in this state is close()), or a NoSuchElementException, depending on which part of the specification you read. In fact, after (1) is fixed, the Unmarshaller doesn't seem to mind which exception is thrown, even the AssertionError works perfectly well, but it makes sense to fix this code at the same time: the patch causes a NoSuchElementException to be thrown.