XElement Constructor
Initializes a new instance of the XElement class.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
| Name | Description | |
|---|---|---|
![]() | XElement(XElement^) | |
![]() | XElement(XName^) | Initializes a new instance of the XElement class with the specified name. |
![]() | XElement(XName^, Object^) | Initializes a new instance of the XElement class with the specified name and content. |
![]() | XElement(XName^, array<Object^>^) | Initializes a new instance of the XElement class with the specified name and content. |
![]() | XElement(XStreamingElement^) | Initializes a new instance of the XElement class from an XStreamingElement object. |
For details about the valid content that can be passed to this constructor, see Valid Content of XElement and XDocument Objects1.
There is an implicit conversion from string to XName. Typical use of this constructor is to specify a string as the parameter instead of creating a new XName.
When creating an element in a namespace, typical use is to use the addition operator overload with an XNamespace and a string to create an XName. For more information, see Working with XML Namespaces.
