var xml ="<?xml version=\"1.0\"?>\r\n<root>\r\n <Test a=\"1\" b=\"2\" c=\"3\"/>\r\n</root>";
XDocument doc = XDocument.Parse(xml);
var attributes = doc.Descendants("Test").SelectMany(x=> x.Attributes())
.Select(a=>new{Name =a.Name, Value=a.Value});
result:
Name Value
a 1
b 2
c 3
UPDATE:
======
if you don't need to specify any element names in the code, just use
Descendants()
var attributes = doc.Descendants().SelectMany(x=> x.Attributes())
.Select(a=>new{Name =a.Name, Value=a.Value});