Add shortcut accessors for `json` and `xml`

This makes reading/dealing with xml & json easier. It also leaves room
to add other commonly used data types in the future if necessary.
Fix loading invalid XML

Add tests for invalid XML + invalid JSON.