Fix #2355 - check for correct DOM error on XML parse failure
Created by: davemevans
Also added a test.
Requires jsdom as no other node xml parser I can find seems to follow the spec wrt parsererror
. We could consider replacing xmldom used elsewhere to cut out a dev dependency.