code: protected boolean isEndTagEvent(XMLEvent event, QName tagName) {
          return event.isEndElement()
                  && event.asEndElement().getName().equals(tagName);
      }
docs: Test an event to see whether it is an end tag with the expected name.