code: public static void ensureChildElement(DomXmlElement parentElement, DomXmlElement childElement) {
      Node parent = childElement.unwrap().getParentNode();
      if (parent == null || !parentElement.unwrap().isEqualNode(parent)) {
        throw LOG.elementIsNotChildOfThisElement(childElement, parentElement);
      }
    }
docs: Ensures that the element is child element of the parent element.
  
  @param parentElement the parent xml dom element
  @param childElement the child element
  @throws SpinXmlElementException if the element is not child of the parent element