private void load() { XmlSerializer xmlSerializer = new XmlSerializer(typeof(EffectDefinitionLibrary)); EffectDefinition a = new EffectDefinition(); EffectDefinition b = new EffectDefinition(); a.Name = "BumpRigid.fxo"; b.Name = "FoliagePick.fxo"; EffectsDefinitions.Add(a); EffectsDefinitions.Add(b); FileStream fileStream = new FileStream("test.xml", FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write); xmlSerializer.Serialize(fileStream, this); fileStream.Close(); }