title: how to append text in top and end of the .xml file using java?
body: <p>I have an below xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;reRoot&gt;
  &lt;reNode&gt; world&lt;/reNode&gt;
  &lt;/reRoot&gt;
  </code></pre>
  
  <p>i would like to display my xml file after append the text as below,</p>
  
  <pre><code>Linesaddedbeforexml
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;reRoot&gt;
      &lt;reNode&gt; world&lt;/reNode&gt;
      &lt;/reRoot&gt;
  Linesaddedafterxml
  </code></pre>
  
  <p>how to achieve this useing java,i tried Filewriter but the alignment not proper after writing it.,
  need help in solution with sample logic code .</p>