code: public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
          Element child = doc.createElement(elementName);
          Text text = doc.createTextNode(elementValue);
          child.appendChild(text);
          parentElement.appendChild(child);
      }
docs: Add a child element to a parent element
  
  @param doc
  @param parentElement
  @param elementName
  @param elementValue