Here you can find the source of skip(XmlPullParser parser)
public static void skip(XmlPullParser parser) throws XmlPullParserException, IOException
//package com.java2s; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; public class Main { public static void skip(XmlPullParser parser) throws XmlPullParserException, IOException { int depth = 1; if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser must be on start tag"); }/*from ww w .jav a2s . c o m*/ while (depth > 0) { switch (parser.next()) { case XmlPullParser.START_TAG: depth++; break; case XmlPullParser.END_TAG: depth--; break; } } } }