Need help saving GET request response in XML format (or converting to JSON) and then doing a POST request after

Please note, I know you can simply copy and paste the response text, but I would like to set up a script that will run and do this automatically