I am no expert with LINQ to XML.
But I did some googling and it seems as though you need to use Descendants instead of Elements.
How to: Retrieve a Single Attribute (LINQ to XML):
http://msdn.microsoft.com/en-gb/library/bb387086.aspx[
^]
var messagesList = (from message in messagesElement.Descendants("add")
select new
{
Connectionstring = message.Attribute("connectionString").Value,
Provider = message.Attribute("providerName").Value,
Name = message.Attribute("name").Value
}).ToList();
Hope that helps out.