Mark your class with the following attributes:
[XmlType("Account")]
[XmlRoot("Account")]
The XmlType attribute will result in the output requested in the OP. Per the documentation:
Controls the XML schema that is generated when the attribute target is serialized by the XmlSerializer
Related Contents:
- Use the XmlInclude or SoapInclude attribute to specify types that are not known statically
- XML Serialization and namespace prefixes
- Reading from memory stream to string
- C# XmlSerializer BindingFailure
- Why doesn’t XmlSerializer support Dictionary?
- Memory Leak using StreamReader and XmlSerializer
- Deserialize XML To Object using Dynamic
- XmlSerializer won’t serialize IEnumerable
- What are the correct version numbers for C#?
- C# List to string with delimiter
- Most Useful Attributes [closed]
- Unity Scripts edited in Visual studio don’t provide autocomplete
- How can I format a number into a string with leading zeros?
- Page vs Window in WPF?
- How to create JSON string in C#
- Serializing a list to JSON
- Custom numeric format string to always display the sign
- Getter and Setter declaration in .NET [duplicate]
- GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration
- reading from app.config file
- Linq order by boolean
- Check if one IEnumerable contains all elements of another IEnumerable
- Accessing Imap in C# [closed]
- How to read a text file reversely with iterator in C#
- Entity Framework Code First Date field creation
- Converting Stream to String and back
- Using app.config in .Net Core
- Accessing a resource via codebehind in WPF
- How to pass the smart screen on Win8 when install a signed application?
- Difference between ASP.NET Core (.NET Core) and ASP.NET Core (.NET Framework)
- Making a generic property
- Timezone Abbreviations
- C# and arrays of anonymous objects
- Decoding T-SQL CAST in C#/VB.NET
- How to calculate bounce angle?
- Error in a .g.cs file?
- How to open a new form from another form
- How to convert Bitmap to a Base64 string?
- How to use “InternalsVisibleTo” attribute with Strongly named assembly?
- C# Convert ReadOnlyMemory to byte[]
- How to convert an Expression to a Predicate
- Double quote string replace in C#
- Stick Layout in Xamarin Forms to bottom
- How do I log a custom field in NLog to database?
- How to get MAX value from Dictionary?
- Cross-platform file name handling in .NET Core
- Is there a runtime benefit to using const local variables?
- How to handle add to list event?
- how to set the query timeout from SQL connection string
- ‘HttpPostedFileBase’ in Asp.Net Core 2.0