nextTag

open fun nextTag(): EventType

Call next() and return event if it is START_TAG or END_TAG otherwise throw an exception.

It will skip whitespace TEXT before actual tag if any.

essentially it does this

int eventType = next();
if(eventType == TEXT && isWhitespace()) { // skip whitespace
eventType = next();
}
if (eventType != START_TAG && eventType != END_TAG) {
throw new XmlPullParserException("expected start or end tag", this, null);
}
return eventType;