XmlRootAttribute Constructor (String)

July 28, 2014

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

© 2014 Microsoft