I'm totally stumped as to how can I achieve XML structure such as this:
<sizes type=”1”>
<size status=”1”>L</size>
<size status=”1”>XL</size>
<size status=”0”>XXL</size>
<sizes>
I am able to create such structure:
<sizes>
<size>L</size>
<size>XL</size>
<size>XXL</size>
<sizes>
With XmlArray
and XmlArrayItem
attributes.
[XmlArray(ElementName = "sizes")]
[XmlArrayItem(ElementName = "size")]
But what I'm unable to do is to add those custom attributes. How do I go about doing that? Do I have to create a new object that'll hold those values and set a custom attribute for it?