public HttpResponseMessage GetAllNewsById(int id) { List<News> news = new NewsRepository().GetAllNews().ToList(); return new HttpResponseMessage { RequestMessage = Request, Content = new XmlContent(SimpleXmlConverter.ToXmlDocument(news.FindAll(p => p.Id == id), "NewsRoot")) }; }