title: Appending new tag to the existing xml using java
body: <p>My source code needs to append/add new tags between some existing tags to XML document what I have on my hard-disk. I am seriously confused what kind of parser do I need to use to complete this task.</p>
  
  <p>XML document what I have looks similar to:</p>
  
  <pre><code>&lt;school&gt;
  &lt;teacher&gt;
  &lt;name&gt;XXXXX&lt;/name&gt;
  &lt;gender&gt;XXXX&lt;/gender&gt;
  &lt;/teacher&gt;
  &lt;/school&gt;
  </code></pre>
  
  <p>Need this XML document to be:</p>
  
  <pre><code> &lt;school&gt;
  &lt;teacher&gt;
  &lt;name&gt;XXXXX&lt;/name&gt;
  &lt;gender&gt;XXXX&lt;/gender&gt;
  &lt;/teacher&gt;
  &lt;!--need to append student tag--&gt;
  &lt;student&gt;
  &lt;name&gt;XXXXXX&lt;/name&gt;
  &lt;gender&gt;XXXXX&lt;/name&gt;
  &lt;/student&gt;
  &lt;/school&gt;
  </code></pre>
  
  <p>So, please help me in choosing efficient xmlparser in achieving this job.also, I appreciate if you can show me sample source code to achieve this task.</p>
  
  <p>Thanks in advance..</p>