code: @Override
      public long insertElementAsRightSibling(final QName pQName) throws TTException {
          checkState(!mDelegate.isClosed(), "Transaction is already closed.");
          checkNotNull(pQName);
          checkState(
              mDelegate.getCurrentNode() instanceof ITreeStructData,
              "Insert is not allowed if current node is not an StructuralNode (either Text or Element), but was %s",
              mDelegate.getCurrentNode());
  
          final long parentKey = mDelegate.getCurrentNode().getParentKey();
          final long leftSibKey = mDelegate.getCurrentNode().getDataKey();
          final long rightSibKey = ((ITreeStructData)mDelegate.getCurrentNode()).getRightSiblingKey();
          final ElementNode node = createElementNode(parentKey, leftSibKey, rightSibKey, 0, pQName);
  
          mDelegate.setCurrentNode(node);
          adaptForInsert(node, false);
          adaptHashesWithAdd();
  
          return node.getDataKey();
      }
docs: {@inheritDoc}