@Override
  public void endElement(final String namespaceURI, final String localName,
                         final String qName) throws SAXException {

    if (suppress) {
      return;
    }

    flushCharacters();

    if (!atRoot) {
      final Parent p = currentElement.getParent();
      if (p instanceof Document) {
        atRoot = true;
      }
      else {
        currentElement = (Element)p;
      }
    }
    else {
      throw new SAXException(
        "Ill-formed XML document (missing opening tag for "
        + localName + ")");
    }
  }
@Override
  public void endElement(final String namespaceURI, final String localName,
                         final String qName)