private StartElement advanceToStartElement ( ) throws Exception { while ( reader . hasNext ( ) ) { XMLEvent event = nextEvent ( "advnc " ) ; if ( event . isStartElement ( ) ) { return event . asStartElement ( ) ; } } throw new IllegalArgumentException ( "Unexpected end of document" ) ; }
reader can be anywhere but normally at StartDocument