code: private String getCData(final Node n) {
      StringBuffer buf = new StringBuffer();
      NodeList nl = n.getChildNodes();
  
      for (int x = 0; x < nl.getLength(); x++) {
        Node innerNode = nl.item(x);
  
        if (
          (innerNode.getNodeType() == Node.TEXT_NODE)
            || (innerNode.getNodeType() == Node.CDATA_SECTION_NODE)) {
          buf.append(innerNode.getNodeValue());
        }
      }
  
      return buf.toString();
    }
docs: Get contents of CDATASection.
  @param n CDATASection
  @return text content of all text or CDATA children of node.