Can you share the $ip? You can try set-content instead of out-file, since out-file encodes in unicode. Instead of curl you can try invoke-webrequest or invoke-restmethod. I don’t see how xml can be valid but not readable by a browser.
You could use the native curl option –output to write the output to a file instead of the standard out (console). To learn more about the available options for curl you should run