// prepare XmlTextWriter
XmlTextWriter w = new XmlTextWriter(fileName, new UTF8Encoding(false));
w.Formatting = Formatting.Indented;
w.WriteStartDocument();
w.WriteStartElement("Grids");
// save first grid
w.WriteStartElement(c1FlexGrid1.Name);
c1FlexGrid1.WriteXml(w);
w.WriteEndElement();
// save second grid
w.WriteStartElement(c1FlexGrid2.Name);
c1FlexGrid2.WriteXml(w);
w.WriteEndElement();
// close document
w.WriteEndElement();
w.Close();
// load document from file
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
XmlNode n = doc.SelectSingleNode("Grids");
// load grids in reverse order
c1FlexGrid2.ReadXml(n.ChildNodes[0]);
c1FlexGrid1.ReadXml(n.ChildNodes[1]);