I have the following XML which needs deserializing/serializing:
<instance>
<dog>
<items>
<item>
<label>Spaniel</label>
</item>
</items>
</dog>
<cat>
<items>
<item>
<label>Tabby</label>
</item>
</items>
</cat>
</instance>
I cannot change the XML structure.
I need to map this to the following class:
[Serializable, XmlRoot("instance")]
public class AnimalInstance
{
public string Dog { get; set; }
public string Cat { get; set; }
}
I'm not really sure where to start on this one without manually parsing the XML. I'd like to keep the code as brief as possible. Any ideas? (and no, my project doesn't actually involve cats and dogs).