code: public void endElement (String uri, String localName, String qName)
      throws SAXException
      {
          boolean seenElement = (state == SEEN_ELEMENT);
          state = stateStack.pop();
          if (seenElement) {
              doNewline();
              doIndent();
          }
          super.endElement(uri, localName, qName);
      }
docs: Add newline and indentation prior to end tag.
  
  <p>If the element has contained other elements, the tag
  will appear indented on a new line; otherwise, it will
  appear immediately following whatever came before.</p>
  
  <p>The newline and indentation will be passed on down
  the filter chain through regular characters events.</p>
  
  @param uri The element's Namespace URI.
  @param localName The element's local name.
  @param qName The element's qualified (prefixed) name.
  @exception org.xml.sax.SAXException If a filter
  further down the chain raises an exception.
  @see org.xml.sax.ContentHandler#endElement