XmlRootAttribute Constructor (String)
Collapse the table of content
Expand the table of content

XmlRootAttribute Constructor (String)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Initializes a new instance of the XmlRootAttribute class and specifies the name of the XML root element.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

public XmlRootAttribute(
	string elementName


Type: System.String
The name of the XML root element.

The following example creates an instance of the XmlRootAttribute and uses it to override the serialization of an instance of a class named "Student".

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft