public DataTable CurrencyTable(List <string> list) { DataTable table = Worker.MakeTable("Currencies"); allCurrency = Worker.StringBuilder(list); var req = new GetCurrencyUnitsRequestBody { currencyNames = allCurrency }; var res = client.GetCurrencyUnits(req); XDocument XDoc = Worker.XmlParser(res.GetCurrencyUnitsResult); int id = 0; foreach (var item in XDoc.Root.Elements().Elements()) { var name = item.Attribute("curr").Value; var rate = item.Value; table.Rows.Add(Worker.CurrencyRow(table.NewRow(), id, name, rate)); id++; } return(table); }