public XElement GetTranslationXMLForLanguageIdAndClassification(int languageId, string classification) { var translations = _repTranslation.GetList(x => x.LanguageId == languageId && x.Classification == classification).ToList(); //FindAllBy.LanguageId.And.Classification(languageId, classification); Language language = _repLanguage.GetSingle(x => x.Id == languageId); //Language.FindSingleBy.Id(languageId) ?? Language.Default; XNamespace xn = XNamespace.Xml; if (translations.Count > 0) { XElement xtranslations = new XElement("Translations", new XAttribute(xn + "lang", language.LanguageCode)); foreach (Translation translation in translations) { xtranslations.Add( new XElement("Translation", new XAttribute("key", translation.Key), new XAttribute("classification", translation.Classification), new XElement("page", new XAttribute("location", translation.PageUrl)), new XElement("value", translation.Value), new XElement("groupname", translation.GroupName) )); } return(xtranslations); } return(null); }