--- old/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java 2012-06-11 16:08:35.843554600 -0700 +++ new/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java 2012-06-11 16:08:34.884024900 -0700 @@ -248,8 +248,10 @@ object = nextEvent(); }catch(XMLStreamException streamException){ fLastEvent = null ; - //xxx: what should be done in this case ? - throw new NoSuchElementException(); + //don't swallow the cause + NoSuchElementException e = new NoSuchElementException(streamException.getMessage()); + e.initCause(streamException.getCause()); + throw e; } return object; }