title: Add comma separated values between tags
body: <p>I have one list in which I am adding data from database. My code is as follows.</p>
  
  <pre><code>list.add(rs.getString(rsMetaData.getColumnName()));
  object.set(list);
  </code></pre>
  
  <p>Now passing this object in output file stream. I am using JAXB and DOM parser for creating XML</p>
  
  <pre><code>write.marshall(object,outputstream);
  </code></pre>
  
  <p>where object= this object is used to set values in xml</p>
  
  <p>As per above code I am getting desired values from columns of database. After this I am setting values from list into a tag in xml. But getting all in separated tags.</p>
  
  <p>My output:</p>
  
  <pre><code>&lt;value&gt;1&lt;/value&gt;
  &lt;value&gt;2&lt;/value&gt;
  &lt;value&gt;3&lt;value&gt;
  &lt;value&gt;4&lt;/value&gt;
  .
  .
  and so on
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>&lt;value&gt;1,2,3,4,5&lt;/value&gt;
  </code></pre>
  
  <p>From my code as mentioned above I am not getting in comma separated code. Please help.</p>
  
  <p>Another approach I am following is using DOM parser:</p>
  
  <pre><code>for(String s:list){
   Element n= doc.createElement("value");
  n.appendChild(doc.createTextNode((s)));
  }
  </code></pre>
  
  <p>through this also I am not getting comma separated values</p>