This is just way cool. Check out Eric White’s blog for a slick use of extension methods to make it easier to convert types in the System.Xml namespace to types in the System.Xml.Linq namespace, and vice-versa. Here’s a quick teaser:
XElement e = new XElement("Root", new XElement("Child", new XAttribute("Att", "1") ) ); XmlNode xmlNode = e.GetXmlNode(); Console.WriteLine(xmlNode.OuterXml); XElement newElement = xmlNode.GetXElement(); Console.WriteLine(newElement);
PingBack from http://www.anith.com/?p=18709