I want to create a custom XML structure as follows:
I\'ve created an implementation of <
Assuming you are using XmlSerializer
, if all you want to do is change how your HotelBasic
class is serialized, you can use XmlTypeAttribute
:
[XmlType(TypeName = "Hotel")]
public class HotelBasic
{
public string Name { get; set; }
}
When used with your HotelList
class it will be serialized as:
One
Two