title: Edit Value of a QDomElement?
body: <p>I need to edit the text of a QDomElement - Eg</p>
  <p>I have an XML file with its content as -</p>
  <pre><code>&lt;root&gt;    
      &lt;firstchild&gt;Edit text here&lt;/firstchild&gt;
  &lt;/root&gt;
  </code></pre>
  <p>How do I edit the text of the child element <code>&lt;firstchild&gt;</code>?</p>
  <p>I don't see any functions in the QDomElement of QDomDocument classes descriptions provided in Qt 4.7</p>
  <p>Edit1 - I am adding more details.</p>
  <p>I need to read, modify and save an xml file. To format of the file is as below -</p>
  <pre><code>&lt;root&gt;    
      &lt;firstchild&gt;Edit text here&lt;/firstchild&gt;
  &lt;/root&gt;
  </code></pre>
  <p>The value of element  needs to be edited.I code to read the xml file is -</p>
  <blockquote>
  <pre><code>QFile xmlFile(&quot;.\\iWantToEdit.xml&quot;);
  xmlFile.open(QIODevice::ReadWrite);
  
  QByteArray xmlData(xmlFile.readAll());
  
  QDomDocument doc;
  doc.setContent(xmlData);
  </code></pre>
  <p>// Read necessary values</p>
  <p>// write back modified values?</p>
  </blockquote>
  <p>Note: I have tried to cast a QDomElement to QDomNode and use the function setNodeValue(). It however is not applicable to QDomElement.</p>
  <p>Any suggestions, code samples, links would we greatly welcome.</p>