import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;public class TestCData {
    public static void main(String[] args) throws Exception {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(new FileInputStream("test.xml"));
        Element e = doc.getDocumentElement();
        NodeList nl = e.getChildNodes();
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            if (n.getNodeType() == Node.CDATA_SECTION_NODE) {
                System.out.println(n.getNodeValue());
            }
        }
    }
}