public static void skipElementAndChildren(String tagName, XMLEventReader reader) throws XMLStreamException {
        // Ignore all the elements that are inside this element
        while (reader.hasNext()) {
            XMLEvent event = reader.nextEvent();
            if (event.isEndElement()) {
                if (event.asEndElement().getName().getLocalPart().equals(tagName)) {
                    reader.next();
                    break;
                }
            }
        }
    }