What's the simplest way for me, in PHP, to:
Retrieve a file from an external URL (http://test.com/thisfile)
If successful, delete local file /root/xml/test.xml
Rename downloaded file to test.xml
Write new file to /root/xml/ folder
This will be a private script, so security or error handling are not important concerns.