public class CsnuService : ICsnuService{ private readonly HttpClient _httpClient; public CsnuService(HttpClient httpClient) { _httpClient = httpClient; } public async Task<IEnumerable<XElement>> GetIndividualElementsAsync(string url) { if (string.IsNullOrEmpty(url)) { throw new ArgumentException("URL cannot be empty.", nameof(url)); } using var response = await _httpClient.GetStreamAsync(url); using var reader = XmlReader.Create(response); return GetIndividualElements(reader); } public IEnumerable<XElement> GetIndividualElements(XmlReader reader) { while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "INDIVIDUALS") { while (reader.ReadToFollowing("INDIVIDUAL")) { yield return (XElement)XElement.ReadFrom(reader); } } } }}