Fixes #6730 : close() xml reader on fromFile() and fromString()

Fixes #6730
This shouldn't be expected after the fix.