<PackageReference Include="System.Xml.XmlSerializer" Version="4.0.11-beta-23409" />

XmlRootAttribute

public class XmlRootAttribute : Attribute
Controls XML serialization of the attribute target as an XML root element.
public string DataType { get; set; }

Gets or sets the XSD data type of the XML root element.

public string ElementName { get; set; }

Gets or sets the name of the XML element that is generated and recognized by the XmlSerializer class's Serialize and Deserialize methods, respectively.

public bool IsNullable { get; set; }

Gets or sets a value that indicates whether the XmlSerializer must serialize a member that is set to null into the xsi:nil attribute set to true.

public string Namespace { get; set; }

Gets or sets the namespace for the XML root element.

Initializes a new instance of the XmlRootAttribute class.

public XmlRootAttribute(string elementName)

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