code: public static Element appendCDATAElement(Element parent, String tagName,
              String value) {
          Element child = appendElement(parent, tagName);
          if (value == null) { // avoid "null" word in the XML payload
              value = "";
          }
  
          Node cdata = child.getOwnerDocument().createCDATASection(value);
          child.appendChild(cdata);
          return child;
      }
docs: Appends the CDATA element to the parent element.
  
  @param parent the parent element
  @param tagName the CDATA element name
  @param value the CDATA element value
  @return the CDATA element added to the parent element