In method buildTree the StaxBuilder builds a JDom tree using parsing-events from XMLStreamReader.
Whenever the END_ELEMENT event gets fired, the local variable: current gets modified, storing the parent object of the just closed element.
If END_ELEMENT gets fired on the top-most element (root-element), null is assigned to current.
Parsing should stop now, having XMLStreamReader fire END_DOCUMENT.
However sometimes the reader fires END_ELEMENT again, the "event-handler" (case END_ELEMENT) tries to access the parent-element from current, but current == null so a NullPointerException is thrown and buildTree fails.
See the attached patch that adds an if clause around the assignment of current and if it's already null the assignment is skipped.