Create specific exceptions for parsing errors

This allows the tests to check for the specific error and not be fooled
by invalid XML files.
Merge branch 'specific-exceptions'