//这是一个符合xml格式的字符串
string xml = "<xmn> <people><name>zs</name><age>22</age></people> <people><name>ls</name><age>23</age></people> </xmn>";
//将string 转化为 XmlDocument对象的xml格式
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
//查找单节点SelectSingleNode,如果存在多个相同节点,默认查找第一个
XmlNode nameNode = xmlDoc.SelectSingleNode("//name");
string name = nameNode.InnerText; //zs
//查找所有节点
XmlNodeList nameNodeList = xmlDoc.SelectNodes("//people");
//遍历取值
foreach (XmlNode nameInfo in nameNodeList)
{
string nameValue = (nameInfo.SelectSingleNode("name")).InnerText;
}