code: private void addNewElement(final EAdd paramAdd, final StartElement paramStartElement) throws TTException {
          assert paramStartElement != null;
          final QName name = paramStartElement.getName();
          long key;
  
          if (mFirstChildAppend == EShredderInsert.ADDASRIGHTSIBLING) {
              key = mWtx.insertElementAsRightSibling(name);
          } else {
              if (paramAdd == EAdd.ASFIRSTCHILD) {
                  key = mWtx.insertElementAsFirstChild(name);
              } else {
                  key = mWtx.insertElementAsRightSibling(name);
              }
          }
  
          // Parse namespaces.
          for (final Iterator<?> it = paramStartElement.getNamespaces(); it.hasNext();) {
              final Namespace namespace = (Namespace)it.next();
              mWtx.insertNamespace(new QName(namespace.getNamespaceURI(), "", namespace.getPrefix()));
              mWtx.moveTo(key);
          }
  
          // Parse attributes.
          for (final Iterator<?> it = paramStartElement.getAttributes(); it.hasNext();) {
              final Attribute attribute = (Attribute)it.next();
              mWtx.insertAttribute(attribute.getName(), attribute.getValue());
              mWtx.moveTo(key);
          }
      }
docs: Add a new element node.
  
  @param paramAdd
  determines wether node is added as first child or right
  sibling
  @param paramStartElement
  the current {@link StartElement}
  @throws TTException
  if inserting node fails