62,046
社区成员
发帖
与我相关
我的任务
分享
XElement root = XElement.Load(xml);
AA aa = new AA();
IEnumerable<XElement> result = from el in root.Elements("body").Elements("paramInfo") select el;
foreach (XElement xe in result)
{
if(xe.Element("paramCode").Value == "Id")
{
aa.Id = xe.Element("paramValue").Value
}
else if(xe.Element("paramCode").Value == "sex")
{
aa.sex = xe.Element("paramValue").Value
}
}