code: @Override
      public long insertElementAsFirstChild(final QName pQName) throws TTException, NullPointerException {
          checkState(!mDelegate.isClosed(), "Transaction is already closed.");
          checkNotNull(pQName);
          checkState(mDelegate.getCurrentNode() instanceof ElementNode
              || mDelegate.getCurrentNode() instanceof DocumentRootNode,
              "Insert is not allowed if current node is not an ElementNode, but was %s", mDelegate
                  .getCurrentNode());
  
          final long parentKey = mDelegate.getCurrentNode().getDataKey();
          final long leftSibKey = NULL_NODE;
          final long rightSibKey = ((ITreeStructData)mDelegate.getCurrentNode()).getFirstChildKey();
          final ElementNode node = createElementNode(parentKey, leftSibKey, rightSibKey, 0, pQName);
  
          mDelegate.setCurrentNode(node);
          adaptForInsert(node, true);
          adaptHashesWithAdd();
  
          return node.getDataKey();
      }
docs: {@inheritDoc}