welcome to Powershell.org. This is a forum for Powershell enthusiasts helping other Powershell enthusiasts with there self written Powershell code. If you’re looking for prewritten scripts or modules you should search Microsoft Technet Script Gallery or the Powershell Gallery or one of the many other places where you can find ready to use code.
If you already have some code you wrote and just got stuck with it you should post this code here - formatted as code please - and ask a specific question about this particular piece of code and we will try to help you solving your problem.
If I got you right you wouldn’t even need a script to accomplish your task. Any software deployment solution should be able to deliver an XML file overwriting an existing one without the need for a script.
Edit: script to overwrite a file