Get type from xsi:type attribute and make it overridable in config using a "type" key.