ToDictionary其实可以简单化,可以传两个lambada表达式,第一个是Key,第二个就是Value。
ToDictionary( key => key.Attribute("key").Value, value => value.Attribute("value").Value );