title: How to modify XML Attributes in Android/Java
body: <p>I have this kind of <code>XML</code> File.</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Test1&gt;
  &lt;typ&gt;task&lt;/typ&gt;
    &lt;datestamp&gt;20150602153306&lt;/datestamp&gt;
    &lt;datecreate&gt;20150602153306&lt;/datecreate&gt;
  &lt;task uuid="92F7F685-C370-4E55-9026-020E3CDCEDE0" status="0"&gt;
      &lt;task_headline&gt;TEST2000&lt;/task_headline&gt;
      &lt;task_subject&gt;There is a Problem.&lt;/task_subject&gt;
      &lt;task_action&gt;Solve it!&lt;/task_action&gt;
      &lt;task_priority color="#E62C29"&gt;high&lt;/task_priority&gt;
      &lt;task_status&gt;200&lt;/task_status&gt;
      &lt;task_note&gt;&lt;/task_note&gt;
  &lt;/task&gt;
  &lt;task uuid="92F7F685-C370-4E55-9026-020E3CDCEDE0" status="0"&gt;
      &lt;task_headline&gt;TEST3000&lt;/task_headline&gt;
      &lt;task_subject&gt;Another Problem&lt;/task_subject&gt;
      &lt;task_action&gt;Solve it again.&lt;/task_action&gt;
      &lt;task_priority color="#E62C29"&gt;high&lt;/task_priority&gt;
      &lt;task_status&gt;200&lt;/task_status&gt;
  &lt;/task&gt;
  &lt;/Test1&gt;
  </code></pre>
  
  <p>This is a example File, so the <code>uuid</code> is in that case equal.</p>
  
  <p>I want to search for a <code>uuid</code> and set the <code>status</code> to 1000.</p>
  
  <p>What I have tried so far:</p>
  
  <pre><code>SAXBuilder builder = new 
  org.jdom2.Document document = builder.build(new FileInputStream(new File(fileDir,filenameWithExt)));
  org.jdom2.Element rootNode = document.getRootElement();
  org.jdom2.Element task1 = rootNode.getChild("task");
  task1.getAttribute(taskItems.get(position).get(task_uuid)).setValue("1000");
  </code></pre>
  
  <p>This is how I create the File:</p>
  
  <pre><code>TransformerFactory transformerFactory = TransformerFactory.newInstance();
  Transformer transformer = transformerFactory.newTransformer();
  DOMSource source = new DOMSource(doc);
  StreamResult result = new StreamResult(new FileOutputStream(new File(fileDir, filenameWithExt)));
  transformer.transform(source, result);
  </code></pre>
  
  <p>But this still not works. How can I search for an Attribute to edit another Attribute?</p>
  
  <p>I hope you understand what I want to do.</p>
  
  <p>Kind Regards</p>