Improve error emitting in bad xml parsing

I'm saying that as it stands right now, the branch doesn't contain what you wanted. It doesn't emit an error event.