XDocument::Parse Method
Creates a new XDocument from a string, optionally preserving white space, setting the base URI, and retaining line information.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | Parse(String^) | Creates a new XDocument from a string. |
![]() ![]() | Parse(String^, LoadOptions) | Creates a new XDocument from a string, optionally preserving white space, setting the base URI, and retaining line information. |
This method parses a string and creates an XML tree.
The following example creates a string that contains XML. It then parses the string into an XDocument.
This example produces the following output:
<!-- comment at the root level -->
<Root>
<Child>Content</Child>
</Root>

