i have tried it but it is not possible using hashtable. till i send you code which i have tried. using System; using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Xml.Serialization; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Collections; namespace HAshxml { [Serializable] public class test { public int height; public int length; public test() { Console.WriteLine("Inside test parameter less constructor"); } public test(int x,int y) { height = x; length = y; Console.WriteLine("Inside test constructor"); } public void GetObjectData(SerializationInfo info,StreamingContext context) { Console.WriteLine("Inside Get object data"); } } public class Program { static void Main(string[] args) { test t = new test(10,20); Hashtable ht = new Hashtable(); ht.Add("h", t); Stream str = File.OpenWrite("D:\\abc.xml"); //BinaryFormatter formatter = new BinaryFormatter(); XmlSerializer ser = new XmlSerializer(typeof(test)); ser.Serialize(str, ht); str.Close(); //formatter.Serialize(str, ht); //str.Close(); //XmlTextWriter xl=new XmlTextWriter ( Console.ReadLine(); } } }