public void SaveConnection(string connectionName, IDataConnection connection, bool saveCredentials)
        {
            try
            {
                XmlDocument doc  = new XmlDocument();
                XmlElement  root = null;
                if (File.Exists(FileName))
                {
                    doc.Load(FileName);
                    root = doc.DocumentElement;
                    if (root != null)
                    {
                        if (root.Name != xmlRootName)
                        {
                            MessageBox.Show(string.Format("Document element is '{0}', '{1}' expected",
                                                          root.Name, xmlRootName));
                            return;
                        }
                        if (root.SelectSingleNode(string.Format("Connection[Name = '{0}']", connection.Name)) != null)
                        {
                            return;
                        }
                    }
                }
                if (root == null)
                {
                    root = doc.CreateElement(xmlRootName);
                    doc.AppendChild(root);
                }

                XmlElement nameElement = doc.CreateElement("Name");
                nameElement.AppendChild(doc.CreateTextNode(connectionName));

                XmlElement connectionStringElement = doc.CreateElement("ConnectionString");
                connectionStringElement.AppendChild(doc.CreateTextNode(connection.CreateConnectionString(!saveCredentials)));

                XmlElement connectionElement = doc.CreateElement("Connection");
                connectionElement.AppendChild(nameElement);
                connectionElement.AppendChild(connectionStringElement);

                root.AppendChild(connectionElement);
                doc.Save(FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Cannot save connection to '{0}' because of exception:{1}{1}{2}", FileName,
                                              Environment.NewLine, ex.Message));
            }
        }