title: Get child node using self id
body: <p>I'm trying to get child node of an xml. I have an attribute named "id" in my parent node. Here's the xml contents:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;languages&gt;
      &lt;item id="button_back"&gt;
          &lt;turkish&gt;geri&lt;/turkish&gt;
          &lt;english&gt;back&lt;/english&gt;
      &lt;/item&gt;
      &lt;item id="button_install"&gt;
          &lt;turkish&gt;seçilileri kur&lt;/turkish&gt;
          &lt;english&gt;install selected&lt;/english&gt;
      &lt;/item&gt;
  &lt;/languages&gt;
  </code></pre>
  
  <p>Say I want to get value of turkish tag. How can I do this? Here's what I tried:</p>
  
  <pre><code>using (XmlReader xr = XmlReader.Create(@"languages.xml"))
  {
      XDocument xdoc = XDocument.Load(xr);
      var query = from t in xdoc.Descendants("item")
                  where t.Element("id").Value.ToLower() == "button_back" // Edit
                  select new
                  {
                      ID = t.Attribute("id").Value,
                      Turkish = t.Element("turkish").Value
                  };
  
      foreach (var it in query)
      {
          MessageBox.Show(it.Turkish);
      }
  
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> This code is giving me null reference exception for <strike>xr</strike> line with MessageBox.</p>