public class XmlSerializationHelper
{
public static void Serialize<T>(string filename, T obj)
{
XmlSerializer xs = new XmlSerializer(typeof(T));
using (StreamWriter wr = new StreamWriter(filename))
{
xs.Serialize(wr, obj);
}
}
public static T Deserialize<T>(string filename)
{
XmlSerializer xs = new XmlSerializer(typeof(T));
using (StreamReader rd = new StreamReader(filename))
{
return (T)xs.Deserialize(rd);
}
}
}
(it's not specifically for generic collections, it works for any XML-serializable object)
I'm not sure if that's what you were looking for... if not, please detail what you need