XElement.Parse Method (String)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Load an XElement from a string that contains XML.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Parameters
- text
- Type: System.String
A String that contains XML.
This method does not preserve white space. If you want to preserve white space in the XML tree, use the overload of the Parse method that takes LoadOptions as a parameter.
LINQ to XML's loading functionality is built upon XmlReader. Therefore, you might catch any exceptions that are thrown by the XmlReader.Create overload methods and the XmlReader methods that read and parse the document.