private void CopyClipButtonClick(object sender, RoutedEventArgs e)
 {
     if (XmlDoc != null)
     {
         Clipboard.SetText(XmlDoc.BeautifyXml());
     }
 }
        private void SaveToFileButton_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var fileSave = new SaveFileDialog
                {
                    Filter   = "Xml Files (*.xml)|*.xml",
                    FileName = "configuration.xml"
                };

                var saveResult = fileSave.ShowDialog();

                if (saveResult.HasValue && saveResult.Value)
                {
                    File.WriteAllText(fileSave.FileName, XmlDoc.BeautifyXml());
                }
            }
            catch (Exception ex)
            {
                ex.LogException();
            }
        }