title: Writing XML Nodes in QtXML (QDomElement)
body: <p>I would like to write Nodes like </p>
  
  <pre><code>&lt;name&gt;Peter&lt;/name&gt; 
  </code></pre>
  
  <p>(with start and end tag) into a QDomDocument.</p>
  
  <p>When I create QDomElements and append them as child to a parent element:</p>
  
  <pre><code>QDomElement node = doc.createElement("node");
  parent.appendChild(node);
  </code></pre>
  
  <p>They are added as</p>
  
  <pre><code>&lt;node/&gt;
  </code></pre>
  
  <p>to the parent element. The parent automatically gets a start and end tag so the file would look like this:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;node/&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>But how do I add a value to my node so that it looks like I want it (with value between start and end tag). Adding a new QDomElement as child to node it would just look like . Adding attribute would show up like ?</p>
  
  <p>Would be great if anyone could help me! Thanks!</p>