I am trying to read a very simple xml file using linq. I know how to do it using for loops over child nodes but I am trying to learn linq. Anyways, I have a file: 

```
<firstElement>
  <Setting Name="appDataPath" Value="some\\path" />
  <Setting Name="appConfigFileName" Value="somename.xml" />
  <Setting Name="appConfigFilePath"  Value="some\\path" />
</firstElement>

```

and I want to get the setting attributes. I have this code: 

```
//Load xml
XDocument xdoc = XDocument.Load(fullyQualifiedPath);

var settings = from item in xdoc.Descendants("firstElement")
     select new
     {
         name = item.Attribute("Name").Value,
         val = item.Attribute("Value").Value
     };

     // create a dictionary
     Dictionary<string, string> settingsDictionary = 
                        new Dictionary<string, string>();

   //Loop through results
   foreach (var setting in settings)
   {
      settingsDictionary.Add(setting.name, setting.val);
   }

   xdoc.Save(fullyQualifiedPath);

```

For some reason settings is null after the query. Am I missing something?