code: public int nextTag() throws XmlPullParserException, IOException {
          next();
          if (type == TEXT && isWhitespace) {
              next();
          }
  
          if (type != END_TAG && type != START_TAG) {
              throw new XmlPullParserException("unexpected type", this, null);
          }
  
          return type;
      }
docs: utility methods to make XML parsing easier ...