The setup:
class Item
{
private int _value;
public Item()
{
_value = 0;
}
public int Value { get { return _value; } set { _valu
I am not sure if I am missing something, but do you want the resulting xml to be
name val
-
1
2
If so, just apply the XmlRoot attribute to the itemcollection class and set the element name...
[XmlRoot(ElementName="ItemCollection")]
public class ItemCollection : Collection-
{
[XmlElement(ElementName="Name")]
public string Name {get;set;}
}
This will instruct the serializer to output the required name for you collection container.