[XML] fixed recognition of invalid brackets