curl_xml plugin: Move the setting of type_instance to a separate function.