title: Check if specific xml node exists
body: <p>I am trying to check if node "DEF" exists in my xml file</p>
  
  <p>My xml file looks like this:</p>
  
  <pre><code>&lt;Struct&gt;
     &lt;A&gt;
        &lt;ABC&gt;
        &lt;/ABC&gt;
        &lt;DEF&gt;
        &lt;/DEF&gt;
     &lt;/A&gt;
     &lt;B&gt;
        &lt;GHI&gt;
        &lt;/GHI&gt;
     &lt;/B&gt;
  &lt;/Struct&gt;
  </code></pre>
  
  <p>And my code looks like this:</p>
  
  <pre><code>XmlDocument stru = new XmlDocument();
  stru.Load(path + "Structure.xml");
  if (stru.ChildNodes[0].HasChildNodes)
  {
      for (int i = 0; i &lt; stru.ChildNodes[0].ChildNodes.Count; i++)
      {
          if (stru.ChildNodes[0].ChildNodes[i].Attributes["DEF"] != null)
          {
              enabled = true;
              break;
          }
          else
          {
              MessageBox.Show("no");
          }
  
      }
  }
  else { MessageBox.Show("Error!"); }
  </code></pre>
  
  <p>And it immediately shows messagebox with "Error!" in it</p>