public class CSettings { public bool bFoobar; public string stBaz; } CSettings _oSettings; XmlSerializer s = new XmlSerializer(typeof(CSettings)); System.IO.TextWriter xw = new System.IO.StreamWriter("Init.xml", false, System.Text.Encoding.UTF8); s.Serialize(xw, _oSettings); xw.Close(); StreamReader sr = new StreamReader("FedexInit.xml", true); XmlSerializer s = new XmlSerializer(typeof(CSettings)); _oSettings = (CSettings)(s.Deserialize(sr)); sr.Close();