code: @Override
      public void begin(String namespaceURI, String name, Attributes attributes)
          throws Exception {
  
          XMLReader xmlReader = getDigester().getXMLReader();
          Document doc = documentBuilder.newDocument();
          NodeBuilder builder = null;
          if (nodeType == Node.ELEMENT_NODE) {
              Element element = null;
              if (getDigester().getNamespaceAware()) {
                  element =
                      doc.createElementNS(namespaceURI, name);
                  for (int i = 0; i < attributes.getLength(); i++) {
                      element.setAttributeNS(attributes.getURI(i),
                                             attributes.getLocalName(i),
                                             attributes.getValue(i));
                  }
              } else {
                  element = doc.createElement(name);
                  for (int i = 0; i < attributes.getLength(); i++) {
                      element.setAttribute(attributes.getQName(i),
                                           attributes.getValue(i));
                  }
              }
              builder = new NodeBuilder(doc, element);
          } else {
              builder = new NodeBuilder(doc, doc.createDocumentFragment());
          }
          xmlReader.setContentHandler(builder);
  
      }
docs: Implemented to replace the content handler currently in use by a
  NodeBuilder.
  
  @param namespaceURI the namespace URI of the matching element, or an
  empty string if the parser is not namespace aware or the element has
  no namespace
  @param name the local name if the parser is namespace aware, or just
  the element name otherwise
  @param attributes The attribute list of this element
  @throws Exception indicates a JAXP configuration problem