As a comment in XMLReaderImpl#standaloneSet() already notes, return value is
incorrect. It should only denote whether input document has a value for
'standalone' xml declaration pseudo-attribute; not whether it has and value is
'yes' (for latter there is XMLStreamReader.isStandalone() method).
It looks like underlying parser implementation does not keep track of this
information, so there may not be a trivially easy fix. Hopefully not too hard to