code: public void startElement(String namespaceURI,
                               String localName,
                               String qualifiedName,
                               Attributes attributes)
              throws SAXException {
          currentlyInLeafElement = false;
          currentDepth ++;
          currentElement = qualifiedName;
          // Emit element name
          write(nl + indent(+1) + "<" +
                  getName(localName, qualifiedName));
  
          // Emit each attribute name/value pair in this element
          if (attributes != null) {
              for (int i = 0; i < attributes.getLength(); i++) {
                  String attributeName = getName(attributes.getLocalName(i),
                          attributes.getQName(i));
                  write(" " + attributeName + "=\"" +
                          attributes.getValue(i) + "\"");
              }
          }
          write(">");
      }
docs: Overrides <code>startElement(...)</code> in
  <code>org.xml.sax.helpers.DefaultHandler</code>,
  which in turn implements <code>org.xml.sax.ContentHandler</code>.
  Called for each start tag encountered.
  
  @param namespaceURI Required if the namespaces property is true.
  @param attributes The specified or defaulted attributes.
  @param localName The local name (without prefix), or the empty
  string if Namespace processing is not being performed.
  @param qualifiedName The qualified name (with prefix), or the
  empty string if qualified names are not available.