You don't need code to do this. You can use a rule that concatenates the URL of your server with the name of your XML form. If you need to get the URL of your server, you can get the Solution location using code. This is covered in the SDK (go to Resources on the right hand side of the main InfoPathDev.com homepage).