Created
July 29, 2012 08:54
-
-
Save aturgarg/3196819 to your computer and use it in GitHub Desktop.
XmlDocument <-> XDocument conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private XDocument ConvertXmlDocumentToXDocument(XmlDocument xmlDoc) | |
{ | |
return XDocument.Load(xmlDoc.CreateNavigator().ReadSubtree()); | |
} | |
private XmlDocument ConvertXDocumentToXmlDocument(XDocument xDoc) | |
{ | |
var xmldoc = new XmlDocument(); | |
xmldoc.Load(xDoc.CreateReader()); | |
return xmldoc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment