allow deserializing JSON and XML, even with ActiveRecord mixed in. i don't like the switch, we should have a generic way to hook into format processing (see comment).