'Loads the new-style job configuration from options in the job config file (by default, job_conf.xml).
:param tree: Object representing the root ``<job_conf>`` object in the job config file.
:type tree: ``xml.etree.ElementTree.Element``'

def __parse_job_conf_xml(self, tree):

    root = tree.getroot()
    log.debug(('Loading    job    configuration    from    %s' % self.app.config.job_config_file))
    plugins = root.find('plugins')
    if (plugins is not None):
        for plugin in self._findall_with_required(plugins, 'plugin', ('id', 'type', 'load')):
            if (plugin.get('type') == 'runner'):
                workers = plugin.get('workers', plugins.get('workers', JobConfiguration.DEFAULT_NWORKERS))
                runner_kwds = self.__get_params(plugin)
                if (not self.__is_enabled(runner_kwds)):
                    continue
                runner_info = dict(id=plugin.get('id'), load=plugin.get('load'), workers=int(workers), kwds=runner_kwds)
                self.runner_plugins.append(runner_info)
            else:
                log.error(('Unknown    plugin    type:    %s' % plugin.get('type')))
        for plugin in self._findall_with_required(plugins, 'plugin', ('id', 'type')):
            if ((plugin.get('id') == 'dynamic') and (plugin.get('type') == 'runner')):
                self.dynamic_params = self.__get_params(plugin)
    if self.app.config.use_tasked_jobs:
        self.runner_plugins.append(dict(id='tasks', load='tasks', workers=self.app.config.local_task_queue_workers))
    handlers_conf = root.find('handlers')
    self._init_handlers(handlers_conf)
    if (not self.handlers):
        raise ValueError('Job    configuration    file    defines    no    valid    handler    elements.')
    self.default_handler_id = self._get_default(self.app.config, handlers_conf, list(self.handlers.keys()))
    destinations = root.find('destinations')
    job_metrics = self.app.job_metrics
    for destination in self._findall_with_required(destinations, 'destination', ('id', 'runner')):
        id = destination.get('id')
        destination_metrics = destination.get('metrics', None)
        if destination_metrics:
            if (not util.asbool(destination_metrics)):
                job_metrics.set_destination_instrumenter(id, None)
            else:
                metrics_conf_path = self.app.config.resolve_path(destination_metrics)
                job_metrics.set_destination_conf_file(id, metrics_conf_path)
        else:
            metrics_elements = self._findall_with_required(destination, 'job_metrics', ())
            if metrics_elements:
                job_metrics.set_destination_conf_element(id, metrics_elements[0])
        job_destination = JobDestination(**dict(destination.items()))
        params = self.__get_params(destination)
        if (not self.__is_enabled(params)):
            continue
        job_destination['params'] = params
        job_destination['env'] = self.__get_envs(destination)
        destination_resubmits = self.__get_resubmits(destination)
        if destination_resubmits:
            resubmits = destination_resubmits
        else:
            resubmits = self.default_resubmits
        job_destination['resubmit'] = resubmits
        self.destinations[id] = (job_destination,)
        if (job_destination.tags is not None):
            for tag in job_destination.tags:
                if (tag not in self.destinations):
                    self.destinations[tag] = []
                self.destinations[tag].append(job_destination)
    self.default_destination_id = self._get_default(self.app.config, destinations, list(self.destinations.keys()))
    resources = root.find('resources')
    if (resources is not None):
        self.default_resource_group = resources.get('default', None)
        for group in self._findall_with_required(resources, 'group'):
            id = group.get('id')
            fields_str = (group.get('fields', None) or group.text or '')
            fields = [f for f in fields_str.split(',') if f]
            self.resource_groups[id] = fields
    tools = root.find('tools')
    if (tools is not None):
        for tool in self._findall_with_required(tools, 'tool'):
            id = tool.get('id').lower().rstrip('/')
            if (id not in self.tools):
                self.tools[id] = list()
            self.tools[id].append(JobToolConfiguration(**dict(tool.items())))
            self.tools[id][(-1)]['params'] = self.__get_params(tool)
    types = dict(registered_user_concurrent_jobs=int, anonymous_user_concurrent_jobs=int, walltime=str, total_walltime=str, output_size=util.size_to_bytes)
    self.limits = Bunch(registered_user_concurrent_jobs=None, anonymous_user_concurrent_jobs=None, walltime=None, walltime_delta=None, total_walltime={}, output_size=None, destination_user_concurrent_jobs={}, destination_total_concurrent_jobs={})
    limits = root.find('limits')
    if (limits is not None):
        for limit in self._findall_with_required(limits, 'limit', ('type',)):
            type = limit.get('type')
            if (type in ('destination_user_concurrent_jobs', 'concurrent_jobs', 'destination_total_concurrent_jobs')):
                id = (limit.get('tag', None) or limit.get('id'))
                if (type == 'destination_total_concurrent_jobs'):
                    self.limits.destination_total_concurrent_jobs[id] = int(limit.text)
                else:
                    self.limits.destination_user_concurrent_jobs[id] = int(limit.text)
            elif (type == 'total_walltime'):
                self.limits.total_walltime['window'] = (int(limit.get('window')) or 30)
                self.limits.total_walltime['raw'] = types.get(type, str)(limit.text)
            elif limit.text:
                self.limits.__dict__[type] = types.get(type, str)(limit.text)
    if (self.limits.walltime is not None):
        (h, m, s) = [int(v) for v in self.limits.walltime.split(':')]
        self.limits.walltime_delta = datetime.timedelta(0, s, 0, 0, m, h)
    if ('raw' in self.limits.total_walltime):
        (h, m, s) = [int(v) for v in self.limits.total_walltime['raw'].split(':')]
        self.limits.total_walltime['delta'] = datetime.timedelta(0, s, 0, 0, m, h)
    log.debug('Done    loading    job    configuration')
