Using Google Colab, I had same issue*
*i.e.: ParseError: XML or text declaration not at start of entity: line 2, column 0
And, kind of counterintuitively, resolved as follows: Two indents on the import statement. And of course all else after that will need to extra-indent along.