XML の例を見て、デシリアライズする方法を教えてください。しかし、Xml Element 配列を逆シリアル化する必要があります。どうすればいいですか?
<hotels num="1">
<hotel num="1" item="2"></hotel>
<hotel num="2" item="2"></hotel>
<hotel num="3" item="2"></hotel>
<hotel num="4" item="2"></hotel>
<hotel num="5" item="2"></hotel>
</hotels>
[Serializable]
[XmlRoot("hotels")]
public class Hotels
{
[XmlElement("id")]
public string id { get; set; }
[XmlElement("hotel")]
public Hotel hotel { get; set; }
}
[Serializable]
[XmlRoot("hotel")]
public class Hotel
{
[XmlElement("id")]
public string id { get; set; }
[XmlElement("item")]
public string item { get; set; }
}