title: Qt/C++: Having trouble with writing to XML file using QDom
body: <p>For some reason, I cannot write to my XML file. There are no errors as I build my program and the program runs fine. I've added debug statements to my code to make sure the part where I am appending child nodes is being run, and it is. However, it's just not showing up at all in the XML file. Below is the code I have (my code is probably not that good... just started using Qt and C++).</p>
  
  <pre><code>    QDomElement root = doc.documentElement();
      QDomNode child = root.firstChild();
      while (child.nodeName() != "RoutineLibrary") {
          child = child.nextSibling();
          if (child.nodeName() == "RoutineLibrary") {
              QDomElement newRoutine = doc.createElement(QString("TEST"));
              QDomText text = doc.createTextNode("abcdef");
              newRoutine.appendChild(text);
              child.appendChild(newRoutine);
          }
          break;
      }
  </code></pre>