linq操作XML
条件查询
XmlDocument xml = new XmlDocument(); string strUrl = System.Web.HttpContext.Current.Server.MapPath("/Content/ModelFolder/Translation.xml"); xml.Load(strUrl); var selectItemList = new List<Translation>(); XDocument xdoc = XDocument.Load(strUrl); XElement xroot = xdoc.Root;//根节点 var nodes = xroot.Descendants().FirstOrDefault(a => a.Name.LocalName == "Security4");//获取指定的XML节点