public JsonResult TransformLocalizationXmlToJson()
        {
            using (var stream = HttpContext.Request.InputStream)
            {
                var xDoc = XDocument.Load(stream);
                XmlLanguageFileHelper helpr = new XmlLanguageFileHelper();
                var localizations = helpr.TransformXmlToTranslationsList(xDoc);

                return Json(localizations);
            }
        }
        public XmlDocument SaveLocalizations(LocalizationEditorViewModel model)
        {
            XmlLanguageFileHelper languageXmlFileHelper = new XmlLanguageFileHelper();
            languageXmlFileHelper.EnsureLanguagesXPath();

            foreach (var translation in model.Categories.SelectMany(category => category.Translations))
            {
                foreach (var dictionary in translation.Translations)
                {
                    if (!string.IsNullOrWhiteSpace(dictionary.Value))
                    {
                        languageXmlFileHelper.SetTranslation(translation.Key, dictionary.Key, dictionary.Value);
                    }
                }
            }

            languageXmlFileHelper.AddLanguageNames();
            AccessStrategy.SaveXml(languageXmlFileHelper.XmlDoc);
            LocalizationsUpdatedEventHandler.RaiseLocalizationsUpdatedEvent();

            return languageXmlFileHelper.XmlDoc;
        }