Data Contracts for (de)serialize ISO20022 XML messages
$ dotnet add package Iso20022Implements .Net classes for the handling of files that comply with the ISO20022 standard, intended for banking transactions.
Iso20022 Serialization
var serializder = new XmlSerializer(typeof(Iso20022.Contracts.PainM001V00101.Document));
using (var file = File.OpenRead(fileName))
{
var document = (Iso20022.Contracts.PainM001V00101.Document?)serializder?.Deserialize(file);
Assert.NotNull(document);
}