Dear Dynamics-enthusiasts,
I'm currently working on a requirement where the client would like to see an xml opened when a button is clicked on a form.
The form (and its) button work fine, the xml can be collected from the form datasource, and used to call below code:

I was under the impression that this was the needed solution.
However, after trying numerous things, I keep getting the same error:

I was wondering whether anyone knows how to solve the error, or another way to satisfy the requirement (open xml in new browser tab after button click).
All feedback, suggestions and help are more than welcome, and appreciated!
Kind regards,
Adil
Junior D365 developer