private XmlNode SerializeData(MockConfigurationData data)
        {
            XmlSerializer xs    = new XmlSerializer(data.GetType());
            StringWriter  sw    = new StringWriter(CultureInfo.CurrentUICulture);
            XmlTextWriter xmlTw = new XmlTextWriter(sw);

            try
            {
                xmlTw.WriteStartElement(xmlSerializerSection);
                xmlTw.WriteAttributeString("type", data.GetType().AssemblyQualifiedName);
                xs.Serialize(xmlTw, data);
                xmlTw.WriteEndElement();
                xmlTw.Flush();
            }
            finally
            {
                xmlTw.Close();
            }
            XmlDocument doc = new XmlDocument();

            try
            {
                doc.LoadXml(sw.ToString());
            }
            finally
            {
                sw.Close();
            }
            return(doc.DocumentElement);
        }
 private XmlNode SerializeData(MockConfigurationData data)
 {
     XmlSerializer xs = new XmlSerializer(data.GetType());
     StringWriter sw = new StringWriter(CultureInfo.CurrentUICulture);
     XmlTextWriter xmlTw = new XmlTextWriter(sw);
     try
     {
         xmlTw.WriteStartElement(xmlSerializerSection);
         xmlTw.WriteAttributeString("type", data.GetType().AssemblyQualifiedName);
         xs.Serialize(xmlTw, data);
         xmlTw.WriteEndElement();
         xmlTw.Flush();
     }
     finally
     {
         xmlTw.Close();
     }
     XmlDocument doc = new XmlDocument();
     try
     {
         doc.LoadXml(sw.ToString());
     }
     finally
     {
         sw.Close();
     }
     return doc.DocumentElement;
 }