code: public void closeElement() throws XMLException, IOException {
  		if (!Type.START_ELEMENT.equals(event.type))
  			throw new IOException("Invalid call of closeElement: it must be called on a start element");
  		if (event.isClosed) return;
  		ElementContext ctx = event.context.getFirst();
  		do {
  			try { next(); }
  			catch (EOFException e) {
  				throw new XMLException(getPosition(), "Unexpected end", "closeElement(" + ctx.text.asString() + ")");
  			}
  			if (Type.END_ELEMENT.equals(event.type)) {
  				if (event.context.getFirst() == ctx)
  					return;
  			}
  		} while (true);
  	}
docs: Go the the END_ELEMENT event corresponding to the current START_ELEMENT (must be called with a current event to START_ELEMENT).