title: QT: Reading a xml file and parsing it using DOM parser
body: <p>I am not that good with xml, but my basic xml file looks somthing like this.</p>
  
  <pre><code>&lt;MAIN_HEADER&gt;
  
    &lt;HEADER&gt;
      &lt;TITLE&gt;my_title&lt;/TITLE&gt;
      &lt;AUTOR&gt;DNL&lt;/AUTOR&gt;
      &lt;NAME&gt;John&lt;/NAME&gt;
      &lt;AGE&gt;abc&lt;/AGE&gt;
      &lt;SEX&gt;male&lt;/SEX&gt;
      &lt;PLACE&gt;abc&lt;/PLACE&gt;
      &lt;INI_FILE&gt;abc&lt;/INI_FILE&gt;
  
    &lt;/HEADER&gt;
  </code></pre>
  
  
  
  <p>what I want to do is, I need to find 2-3 tags, say for example NAME &amp; SEX
  and store the attribute(John,Male) in another variable.</p>
  
  <p>until now, I have been able to make it read the xml file. </p>
  
  <pre><code>void MainWindow::XMLParser()
  {
          QString path=MainWindow::getWorkingDirectory()+"\\0_Config\\";
          QString string;
          string = path + ui-&gt;ConfigFiles_combo-&gt;currentText(); \\THIS IS WHERE´IT DETERMINES WHICH XML FILE IT IS
          qDebug()&lt;&lt;string;
          QDomDocument document;
          //load the file
          QFile file(string);
          if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
          {
              qDebug()&lt;&lt;"Failed to open the file";
  
          }
  
          else
          {
              if(!document.setContent(false))
              {
                  qDebug()&lt;&lt;"Failed to load document";
  
              }
              file.close();
          }
          QDomElement root = document.firstChildElement();
          qDebug()&lt;&lt;"finished";
  
  }
  </code></pre>
  
  
  
  <p>how do I make it search for the exact tag and store it inside another variable?</p>