title: How to read xml file and How do I append a node inside XML tag file in java
body: <p>I am new to java, i am struggling in one program i don't know how to write it</p>
  
  <p>I need some code that will read in the tasks and apply the appropriate task findings markup into the val.xml file. </p>
  
  <p>For example: </p>
  
  <p>A task in val.xml:</p>
  
  <pre><code>&lt;task name="12-19" additionalIntervalInformationNeeded="No"&gt;
                           Converter (Cleaning)
    &lt;/task&gt;
  </code></pre>
  
  <p>The matching task-findings markup in the findings.xml:</p>
  
  <pre><code>&lt;tf taskid="olive-12-19"&gt;
  &lt;task-findings val="28"&gt;
  &lt;task-finding&gt;
  &lt;title&gt;Left Converter&lt;/title&gt;
  &lt;/task-finding&gt;
  &lt;/task-findings&gt;
  &lt;/tf&gt;
  </code></pre>
  
  <p>So the goal is to use the tasked attribute value from the  element to locate the correct task-findings markup.</p>
  
  <p>Incorporate the  element and all child elements into the task markup (just inside the ending  tag.</p>
  
  <p>The result to the above examples would be as such:</p>
  
  <pre><code>&lt;task name="12-19" additionalIntervalInformationNeeded="No"&gt;
                       Converter (Cleaning)
           &lt;tf taskid="olive-12-19"&gt;
           &lt;task-findings val="28"&gt;
           &lt;task-finding&gt;
           &lt;title&gt;Left Converter&lt;/title&gt;
           &lt;/task-finding&gt;
           &lt;/task-findings&gt;
           &lt;/tf&gt;
   &lt;/task&gt;
  </code></pre>
  
  <p>Please suggest me how to write code.</p>