Load from XML, multiple

Hello! I just started with XML and I wanted practice it with a conversation system stored in a xml file. This is my xml:

<?xml version="1.0" encoding="UTF-8"?>
<AllConversations>
    <Conversation_01>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>
    </Conversation_01>
    <Conversation_02>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>

    </Conversation_02>
    <Conversation_03>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>
            <Item>
                    <Name></Name>
                    <Text></Text>
            </Item>
    </Conversation_03>

</AllConversations>

So my idea is that when I ask for Conversation_03 it return all items inside. For to do it I did this:

[XmlRoot("AllConversations")]
public class ConversationsContainer {

    [XmlArray("Conversation_01")]
    [XmlArrayItem("Item")]
    public List<ConversationClass> conversation1 = new List<ConversationClass>();

    [XmlArray("Conversation_02")]
    [XmlArrayItem("Item")]
    public List<ConversationClass> conversation2 = new List<ConversationClass>();

    [XmlArray("Conversation_03")]
    [XmlArrayItem("Item")]
    public List<ConversationClass> conversation3 = new List<ConversationClass>();


    public static ConversationsContainer Load()
    {
        string path = "Conv_Eng";
        TextAsset _xml = Resources.Load<TextAsset> (path);
        XmlSerializer serializer = new XmlSerializer (typeof(ConversationsContainer));
        StringReader reader = new StringReader (_xml.text);
        ConversationsContainer items = serializer.Deserialize (reader) as ConversationsContainer;
        reader.Close ();
        return items;
    }


}

As you can see I musted to do an Array for every tag “conversation_##”. It works perfectly (just I need change the variable used after Load). But I guess this isn’t very optimal (of course what I am doing isn’t very big and performance will not be a problem, but still I want improve it).

So… What I should look for? Missing something?

Thanks so much for your time and help!

Edit: Sorry, I did a bad title. Can’t edit it. I wanted put “Load from XML, multiple tags in a Container”.

This depends on how you decorated ConversationClass itself. You’ve sort of already done what you’re asking, you just arbitrarily broke them up. Get rid of 02 and 03 and change 01 to just Conversation. Now you have a list of conversations and each conversation has a list of items. If you want to uniquely identify each conversation then you can add an attribute to ConversationClass

[XmlAttribute("name")]
public string Name { get; set; }
<Conversation name="Foo">

</Conversation>
<Conversation name="Bar">

</Conversation>

My ignorance is still very powerful. ^^

Thanks so much for your help, you have totally right! I’ll edit my class to add an attribute for Conversation.