您的 XML 格式不正确。我相信这就是您的 XML 的外观吗?
<lst name="industry">
<int name="Accounting">3</int>
<int name="Engineering">0</int>
<int name="Human Resources and Adminstration">0</int>
<int name="Software/IT">0</int>
</lst>
对于这种情况,你可以做..
XDocument result = XDocument.Load(new StringReader("<lst name=\"industry\">" +
"<int name=\"Accounting\">3</int>" +
"<int name=\"Engineering\">0</int>" +
"<int name=\"Human Resources and Adminstration\">0</int>" +
"<int name=\"Software/IT\">0</int>" +
"</lst>"));
var tmpTable = (from i in result.Descendants("int")
select new
{
Key = i.Attribute("name"),
Value = i.Value
}).ToDictionary(t => t.Key, t => t.Value);