Created
November 15, 2020 15:44
-
-
Save joe-oli/26af5235a2ebe64f40a0f001decf3004 to your computer and use it in GitHub Desktop.
XmlElement to XElement + vice versa
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
Convert XmlElement to XElement | |
--- | |
Private Function ConvertToXmlElement(ByVal elem As XElement) _ | |
As XmlElement | |
Dim xmldoc As New XmlDocument() | |
xmldoc.Load(elem.CreateReader()) | |
Return xmldoc.DocumentElement | |
End Function | |
Convert XElement to XmlElement | |
--- | |
Private Function ConvertToXElement(ByVal elem As XmlElement) As XElement | |
Return XElement.Parse(elem.OuterXml) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment