XML Serialization

Hello,

I am using XML serialization to save data to a file.

[System.Serializable]
public class GameStateData
{
	//Data
	public int[] Flags = new int[100];
}

My question is whether I can be confident that the ordering of the array elements will be retained when the class is loaded from the file into memory. Take the following XML

  <Flags>
    <int>1</int>
    <int>0</int>
    <int>7</int>
  </Flags>

Will that always load into the array in the order of 1, 0, 7; which is what it seems to do? Or can .NET not be relied upon to preserve the ordering of elements in this way?

Yes, you can rely on it.