Another solution which gets at the root cause of the problem is to reconfigure PHP by turning off the short_open_tag option, and using <?php instead of just <?.
This stops PHP reading <?xml as being the start of PHP code - it only recognises the longer form.
Of course, it does mean more work initially (a reconfiguration of PHP, and a global search-and-replace or two on your pages), but the result is more robust (you just have to remember to use <?php, instead of remembering special rules about how to deal with XML headers).