code: public void cdataValue(final String val) throws IOException {
      if (val == null) {
        return;
      }
  
      int start = 0;
  
      while (start < val.length()) {
        int end = val.indexOf("]]", start);
        boolean lastSeg = end < 0;
        String seg;
  
        if (lastSeg) {
          seg = val.substring(start);
        } else {
          seg = val.substring(start, end);
        }
  
        out("<![CDATA[");
        out(seg);
        out("]]>");
  
        if (lastSeg) {
          break;
        }
  
        out("]]");
        start = end + 2;
      }
    }
docs: Create the sequence<br>
  <tag>val</tag>
  
  @param val
  @throws IOException