ensure that parser is closed when parsing a string, to guarantee well formed but not closed XML generates an error