title: reading root element in xml not the child
body: <p>Hi I am working on an application which reads XML file. Here I am trying to read "name" node under the "a"node  not under the node "b".
  When I tried to read the root "name" node I get both nodes.
   Please help me to solve the problem.
  Bellow is the sample.</p>
  
  <pre><code> &lt;a&gt;    
        &lt;x&gt;rrr&lt;/X&gt;
        &lt;b&gt;
          &lt;name&gt; 123 &lt;/name&gt;
        &lt;/b&gt;
        &lt;name&gt; main &lt;/name&gt;
        &lt;c&gt;yyyy&lt;/c&gt;
      &lt;/a&gt;
  
  
  
  
  
      QDomDocument mDocument;
       QDomElement  mDocumentElement;
       if (!mDocument.setContent(file.readAll())) 
       {          
           return ;      
       }      
  
       mDocumentElement = mDocument.documentElement();
       QDomNodeList list  = mDocumentElement.elementsByTagName("a").at(0).toElement().elementsByTagName("name");
  
       int count = list.count();
       for (int i = 0; i &lt; count; i++)
       {
        QString str = list.at(i).nodeValue();
        QMessageBox::information(this, "text", str, QMessageBox::Yes, 0);
       }
  </code></pre>