void Main()
{
string xml = @" <cas:serviceResponse xmlns:cas='http://www.xxx.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>";
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
*/
}