title: How to replace null values in XML
body: <p>I am adding some more tags in xml file by using DOM parser. I am creating some new tags using DOM parser and want to set their values by passing arraylist. My arraylist contains values which I am retrieving from database.</p>
  
  <p>My code is a follows:</p>
  
  <pre><code>loading file using dom parser
  
  
    for(String s:a.List){
   Element n= doc.createElement("value");
  n.appendChild(doc.createTextNode(String.valueOf(s)));
  
      }
  </code></pre>
  
  <p>here I am creating new tag and passing values of s in that tag.</p>
  
  <pre><code>Output I am getting:
  
  &lt;value&gt;1&lt;/value&gt;
  
  &lt;value&gt;2&lt;/value&gt;
  
  &lt;value&gt;3&lt;/value&gt;
  
  &lt;value&gt;null&lt;/value&gt;
  
  &lt;value&gt;null&lt;/value&gt;
  
  &lt;value&gt;4&lt;/value&gt;
  </code></pre>
  
  <p>;
  ;
  so on</p>
  
  <pre><code>Expected output:
  
  &lt;value&gt;1&lt;/value&gt;
  &lt;value&gt;2&lt;/value&gt;
  
  &lt;value&gt;3&lt;/value&gt;
  
  &lt;value/&gt;
  
  &lt;value/&gt;
  
  &lt;value&gt;4&lt;value&gt;
  </code></pre>
  
  <p>I want to remove null which is coming from databse to arraylist and than to xml and get form as mentioned above
  Please help... </p>