Edited:
The answer is to use Linq. For more info see https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml
Edited:
The answer is to use Linq. For more info see https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml