/// <summary> /// The method creats xml file with all products, save it on server and returns it to client /// </summary> /// <returns>The XML file with all products</returns> public FileResult ExportToXML() { TransferData export = new TransferData(); string filePath = Server.MapPath("~/Content/documents/Catalog.xml"); string fileType = "xml"; string fileName = "Catalog.xml"; export.ExportToXML(productService.GetAllElements(), filePath); return(File(filePath, fileType, fileName)); }