Here you can find the source of skip(XMLStreamReader parser)
static protected void skip(XMLStreamReader parser) throws XMLStreamException
//package com.java2s; //License from project: Open Source License import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; public class Main { static protected void skip(XMLStreamReader parser) throws XMLStreamException { while (parser.hasNext()) { int eventType = parser.next(); if (eventType == XMLStreamConstants.START_ELEMENT) { skip(parser);//w w w . j av a 2s . c o m } else if (eventType == XMLStreamConstants.END_ELEMENT) { return; } } } }