private function rebuildNode(\SimpleXMLElement $nodeConfig, $idPrefix)
    {
        /** @var \SimpleXMLElement $node */
        foreach ($nodeConfig as $nodeName => $node) {
            $nodeId = (string) @$node['id'];
            if (in_array($nodeName, $this->processorsNodeNames) && !$nodeId) {
                $autoGeneratedId = $idPrefix.'.'.$this->rebuiltNodesCounter++;
                if ($this->getContainer()->has($autoGeneratedId)) {
                    throw new InvalidConfigurationException('Itinerary name used twice: '.$autoGeneratedId);
                }
                $node->addAttribute('id', $autoGeneratedId);
            }

            $this->rebuildNode($node, $idPrefix);
        }
    }