code: public void insertParentBefore(Node node) throws ChildNodeException {
      if (node != null) {
        if (hasParent()) {
          getParentNode().addChild(node);
          getParentNode().removeChild(this);
        }
        node.addChild(this);
      }
    }
docs: Inserts a new Parent into the tree structure and adds this node as its child.
  
  @param node Node that will become this nodes new Parent.