I have the following Xml :
<Head>
<Name>someName</Name>
<Config>
<Section name='One'/>
<Section name='Two'/>
</Config>
</Head>
and I would like it to map the following object structure:
public class Head{
public String Name {get;set;}
public Config Config {get;set;}
}
public class Config
{
public Section[] Sections { get; set; }
}
public class Section
{
[XmlAttribute(AttributeName="name")]
public String Name { get; set; }
}
How can I do this using Attributes only (if possible?) but without adding a top level < Sections > above < Section > elements, and also keeping the class structure. I have tried with XmlArrayItem, but i can't get the section elements.