Here you can find the source of addCDATA(final String xML)
public static String addCDATA(final String xML)
//package com.java2s; //License from project: Apache License public class Main { public static String addCDATA(final String xML) { String cStart = "<![CDATA["; String cEnd = "]]>"; return new StringBuilder().append(cStart).append(xML).append(cEnd).toString(); }/*from w ww .j a v a 2 s . co m*/ }