usingSystem;usingSystem.IO;usingSystem.Xml.Serialization;[Serializable]publicclassPersonpublicstring Name {get;set;}publicint Age {get;set;}publicclassProgramstaticvoidMain(string[] args)Person person =newPerson{ Name ="John", Age =30};XmlSerializer serializer =newXmlSerializer(typeof(Person));using(FileStream stream =newFileStream("person.xml", FileMode.Create)) serializer.Serialize(stream, person);}