Improve robustness of MavenProjectXmlWriter

Using the bootstrap plugin, I kept getting this error:

[Fatal Error] :346:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
:maven2Gradle FAILED

Turns out the reason was that my pom.xml had this at the top:
<?xml version="1.0" encoding="UTF-8"?>

instead of what the plugin was expecting. 
<?xml version="1.0"?>

This changes makes the search and replace more robust using a regex expression to 
identify to the XML declaration.