ChiakiYu.Common.Extensions.LinqToXmlExtensions.ToXElement C# (CSharp) Method

ToXElement() public static method

将XmlNode转换为XElement
public static ToXElement ( this node ) : System.Xml.Linq.XElement
node this
return System.Xml.Linq.XElement
        public static XElement ToXElement(this XmlNode node)
        {
            var xdoc = new XDocument();
            using (var xmlWriter = xdoc.CreateWriter())
            {
                node.WriteTo(xmlWriter);
            }
            return xdoc.Root;
        }
LinqToXmlExtensions