title: How to generate CDATA block using JAXB?
body: <p>I am using JAXB to serialize my data to XML. The class code is simple as given below. I want to produce XML that contains CDATA blocks for the value of some Args. For example, current code produces this XML:</p>
  
  <pre><code>&lt;command&gt;
     &lt;args&gt;
        &lt;arg name="test_id"&gt;1234&lt;/arg&gt;
        &lt;arg name="source"&gt;&amp;lt;html&gt;EMAIL&amp;lt;/html&gt;&lt;/arg&gt;
     &lt;/args&gt;
  &lt;/command&gt;
  </code></pre>
  
  <p>I want to wrap the "source" arg in CDATA such that it looks like below:</p>
  
  <pre><code>&lt;command&gt;
     &lt;args&gt;
        &lt;arg name="test_id"&gt;1234&lt;/arg&gt;
        &lt;arg name="source"&gt;&lt;[![CDATA[&lt;html&gt;EMAIL&lt;/html&gt;]]&gt;&lt;/arg&gt;
     &lt;/args&gt;
  &lt;/command&gt;
  </code></pre>
  
  <p>How can I achieve this in the below code?</p>
  
  <pre><code>@XmlRootElement(name="command")
  public class Command {
  
          @XmlElementWrapper(name="args")
          protected List&lt;Arg&gt;  arg;
      }
  @XmlRootElement(name="arg")
  public class Arg {
  
          @XmlAttribute
          public String name;
          @XmlValue
          public String value;
  
          public Arg() {};
  
          static Arg make(final String name, final String value) {
              Arg a = new Arg();
              a.name=name; a.value=value;
              return a; }
      }
  </code></pre>