I am trying to creat an xml file, using serialize, with a custom class, and I am getting an exception:"There was an error generating the xml document." I tryed it with a list of strings, and it works, but not with a custom type...Does any one have an idia why?\[code\]public class MyXML{ List<MyClass> Mylist; public XmlSerializer serialize; public MyXML() { Mylist=new List<MyClass>(); serialize = new XmlSerializer(typeof(List<MyClass>)); } public void Save(List<MyClass> newList) { using (FileStream writer = File.OpenWrite(Directory.GetCurrentDirectory() + "/files/MyNewFile.xml")) { serialize.Serialize(writer, newList); } }}\[/code\]