Here you can find the source of skip(XmlPullParser parser)
public static void skip(XmlPullParser parser) throws XmlPullParserException, IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class Main { public static void skip(XmlPullParser parser) throws XmlPullParserException, IOException { if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException(); }//from w w w.j a v a 2 s .c o m int depth = 1; while (depth != 0) { switch (parser.next()) { case XmlPullParser.END_TAG: depth--; break; case XmlPullParser.START_TAG: depth++; break; } } } }