I encountered the same problem and I solved like following.
Following code cause error.
<?xml version="1.0" encoding="UTF-8"?>
So, I simply put a space before ?>.
<?xml version="1.0" encoding="UTF-8" ?>
After I did like that, there was no more error.