I don't know about "recommended". I do know that if you give such a file to a parser and claim that it's an XML document, the parser will tell you (correctly) that it isn't a well-formed XML document.
A well-formed XML document has an optional prolog (the <?xml ... > part) at the beginning followed by a single root element. And nothing else.
If the parser sees a prolog in the middle of the document, it will attempt to treat it as a processing-instruction. And since processing-instructions in an XML document can't be named "xml", you get the error message which tells you that.