See Also: XmlRootAttribute Members
The System.Xml.Serialization.XmlRootAttribute belongs to a family of attributes that controls how the System.Xml.Serialization.XmlSerializer serializes or deserializes an object. For a complete list of similar attributes, see Attributes That Control XML Serialization.
You can apply the System.Xml.Serialization.XmlRootAttribute to a class, structure, enumeration, or interface. You can also apply the attribute to the return value of an XML Web service method.
Every XML document must have a single root element that contains all the other elements. The System.Xml.Serialization.XmlRootAttribute allows you to control how the System.Xml.Serialization.XmlSerializer generates the root element by setting certain properties. For example, specify the name of the generated XML element by setting the XmlRootAttribute.ElementName property.
For more information about using attributes, see Extending Metadata Using Attributes.
You can use the word XmlRoot in your code instead of the longer System.Xml.Serialization.XmlRootAttribute.