title: Select nodes with specific attribute children nodes using xpath
body: <p>I am having small issue reading children nodes from parent node containing specific attribute.</p>
  
  <p>Here is my xml:</p>
  
  <pre><code>&lt;Players&gt;
    &lt;Group Sort="Attack"&gt;
      &lt;Player Name="John"/&gt;
      &lt;Player Name="John"/&gt;
    &lt;/Group&gt;
    &lt;Group Sort="Defense"&gt;
      &lt;Player Name="Thomas"/&gt;
      &lt;Player Name="Frank"/&gt;
    &lt;/Group&gt;
  &lt;/Players&gt;
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>Dim FullList As New XmlDocument
  FullList.Load("FullList.xml")
  Dim ReadPlayer as string = Nothing
  Dim ReadList As XmlNodeList = FullList.SelectNodes("/Players/Group")
  
  For Each ReadNode As XmlNode In ReadList
      If ReadNode IsNot Nothing Then
          Dim ReadNodeAttribute as XmlAttribute = ReadNode .Attributes("Sort")
          If ReadNodeAttribute IsNot Nothing Then
              If ReadNodeAttribute.Value = "Attack" then
                  Dim answer As String = "YES"
                  Dim NameList As XmlNodeList = FullList.SelectNodes("/Players/Group[@Sort = '" &amp; ReadNodeAttribute.Value &amp; "' ]/Player")
                  For Each Name As XmlNode In NameList
                      If Name IsNot Nothing Then
                          Dim NameAttribute As XmlAttribute = Name.Attributes("Name")
                          If NameAttribute IsNot Nothing Then
                              MsgBox(NameAttribute.Value &amp; answer)
                          End If
                      End If
                  Next
              End If
          End If
      End If
  Next
  </code></pre>
  
  <p>The problem is I don't get <code>NameAttribute.Value</code></p>
  
  <p>I think that there is problem with selecting nodes, but I am not sure where exactly.</p>