Crash with a validation error instead of type error

`self.xml` is deliberately left as `None` in some cases; this ensures that we crash with a `ValidationError` in those cases.