code: public static void appendElement(Element parent, Element child) {
          Node tmp = parent.getOwnerDocument().importNode(child, true);
          parent.appendChild(tmp);
      }
docs: Appends another element as a child element.
  
  @param parent the parent element
  @param child the child element to append