title: Best approach to write xml element in jaxb
body: <p>I have the next xml structure binded to a java object using jaxb:</p>
  
  <pre><code>    &lt;my_object&gt;
        &lt;config&gt;.....config parameters&lt;/config&gt;
        &lt;data&gt;
           &lt;type&gt;a_type&lt;/type&gt;
           &lt;values&gt;1.43321, 3.23344, 2.5666&lt;/values&gt;
        &lt;/data
      &lt;/my_object&gt;
  </code></pre>
  
  <p>My java object receives values generated in real time by another object in this way:</p>
  
  <pre><code>myObject.getData().getValues().add(1.1154);
  </code></pre>
  
  <p>and is neccesary to marshal to the xml element when the object has N new values.</p>
  
  <p>I have readed that I can marshall only Double values, but I don't know how exactly achive this.</p>
  
  <p>Thanks in advance.</p>