c# - Attribute value in root node of xml Linq to XML -
while parsing xml linq xml, came across strange behaviour (atleast me). below first xml parsed `<?xml version="1.0" encoding="utf-8"?> <testrun> <unittestresult testname = "arun" outcome = "i"> </unittestresult> <unittestresult testname = "arun1" outcome = "i"> </unittestresult> </testrun>` my code looks xdocument doc = xdocument.parse(filecontents); var result = doc.descendants("unittestresult"); the above works fine. if root node contain attributes same code not working. reason. xml sample below <?xml version="1.0" encoding="utf-8"?> <testrun id="7903b4ff-8706-4379-b9e8-567034b70abb" name="inaambika@inbelw013312a 2016-02-26 16:55:14" runuser="stc\inaambika" xmlns="http://microsoft.com/schemas/visualstudio/teamtest/2010"> <unittestresult testname = "arun" outcome = "...