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

XmlTextAttribute

public class XmlTextAttribute : Attribute
Indicates to the XmlSerializer that the member must be treated as XML text when the class that contains it is serialized or deserialized.
public string DataType { get; set; }

Gets or sets the XML Schema definition language (XSD) data type of the text generated by the XmlSerializer.

public Type Type { get; set; }

Gets or sets the type of the member.

Initializes a new instance of the XmlTextAttribute class.

public XmlTextAttribute(Type type)

Initializes a new instance of the XmlTextAttribute class.