Use same exception for failed XML parsing as JSON.

Currently \RuntimeException for failed JSON parsing and \Exception for failed XML parsing.