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 ; }
Appends the CDATA element to the parent element .