using System.Collections.Generic;
using System.Threading.Tasks;
string xmlUrl = "https://mysafeinfo.com/api/data?list=beatlesalbums&format=xml";
using HttpClient client = new HttpClient();
string xmlData = await client.GetStringAsync(xmlUrl);
XDocument xdoc = XDocument.Parse(xmlData);
var albums = xdoc.Descendants("b")
AlbumName = x.Attribute("Album")?.Value,
ReleaseDate = DateTime.Parse(x.Attribute("ReleaseDate")?.Value ?? "0001-01-01T00:00:00+00:00").ToString("M/d/yyyy"),
Label = x.Attribute("Label")?.Value
.OrderByDescending(a => DateTime.Parse(a.ReleaseDate))
string jsonOutput = JsonConvert.SerializeObject(albums, Formatting.Indented);
Console.WriteLine(jsonOutput);