<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
<cas:authenticationSuccess>
<cas:user>bb</cas:user>
<cas:attributes nid='1'>
<cas:id>2</cas:id>
<cas:loginname>bb</cas:loginname>
<cas:role>2</cas:role>
<cas:realname>bbggg</cas:realname>
</cas:attributes>
</cas:authenticationSuccess>
</cas:serviceResponse>
```void Main()
{
string xml = @"
cas:authenticationSuccess
cas:userbb/cas:user
cas:id2/cas:id
cas:loginnamebb/cas:loginname
cas:role2/cas:role
cas:realnamebbggg/cas:realname
/cas:attributes
/cas:authenticationSuccess
/cas:serviceResponse";
XDocument xmlPage = XDocument.Parse(xml);
XNamespace ns = "http://www.xxx.edu/tp/cas";
var query = from x in xmlPage.Descendants(ns+"authenticationSuccess")
from y in x.Element(ns+"attributes").Elements()
select y;
foreach(XElement item in query)
Console.WriteLine("{0}:\t {1}",item.Name.LocalName,item.Value);
/*
id: 2
loginname: bb
role: 2
realname: bbggg
*/
}