public static int skipElement ( XMLStreamReader xmlReader ) throws XMLStreamException { if ( ! xmlReader . isStartElement ( ) ) { throw new XMLStreamException ( "Current node is not start element" ) ; } if ( ! xmlReader . isEndElement ( ) ) { for ( xmlReader . next ( ) ; ! xmlReader . isEndElement ( ) ; xmlReader . next ( ) ) { if ( xmlReader . isStartElement ( ) ) { skipElement ( xmlReader ) ; } } } return xmlReader . getEventType ( ) ; }
Go to the end of the current element . This include skipping any children element .