I'd avoid using XML, something that maintains the link between the XML structure and the information held would look like:
The xml is much bigger than the information it contains and problem becomes worse if you are storing bits/bools rather than ints.
Pesonally, as chromosome information is so basic, you could write directly to disk in csv format.
As the CSV format is so simple, I'd do something like this:
public class Chromosome
char delimiter = ',';
public List<int> Genes
public override ToString()
StringBuilder sb = new StringBuilder();
foreach(int gene in Genes)
public void ReadString(string csv)
var items = string.split(delimiter);
foreach (string item in items)
I've not tested the above, but you should get the idea. Then all you need do is write to file if required. Google c# streamreader and c# streamwriter for more info.
One thing about my code is that it leaves the serialization in the class, this is not an ideal solution, so you should separate it out. The other thing you could consider is a Custom Serializer