I’ve got a class like this:
[XmlRoot('channel')] public class Channel { [XmlElement('title')] public String Title { get; set; } [WhatElseGoesHere] [XmlArrayItem('item')] public List<Item> Items { get; set; } }
My desired output is this:
<channel> <title>The title</title> <item>{item content}</item> <item>{item content}</item> </channel>
You can try using XmlElementAttribute instead of XmlArrayItemElementAttribute: