<environments>
<environment>
<add key="Test1">
<add key="Test2">
<add key="Test3">
</environments>
</environment>
how to read all the list of key using LINQ tried it seems its not working
XDocument fooXML = XDocument.Load(configurationFileName);
var query = from a in fooXML.Element("environment").Elements("add")
select new
{
key = a.Attribute("key").Value,
val = a.Attribute("Value").Value
};