the xml code you replace with:
https://learn.microsoft.com/en-us/dotnet/api/system.xml.xmldocument?view=net-6.0
the sqlcode you replace with ado.net
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/
and the I/o streams:
https://learn.microsoft.com/en-us/dotnet/api/system.io?view=net-6.0