Java examples for XML:CDATA
new CDATA Element
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Document; import org.w3c.dom.CDATASection; public class Main { public static Element newCDATAElement(Document doc, String nodeName, String value) {// w ww . jav a2 s. c om Element result = doc.createElement(nodeName); CDATASection cdata = doc.createCDATASection(value); result.appendChild(cdata); return result; } }