Symfony Config XML utils - convert DOMElement to array

Code
<?php

use Symfony\Component\Config\Util\XmlUtils;

$file __DIR__.'/city.xml';
echo 
'file content:';
dump(file_get_contents($file));

/* @var $dom \DOMDocument */
$dom XmlUtils::loadFile($file);
$city $dom->getElementsByTagName('City')
    ->
item(0);

echo 
get_class($city);

dump(
    
XmlUtils::convertDomElementToArray($city)
);
Result
file content:
"""
<?xml version="1.0" encoding="UTF-8"?>\n
<List>\n
    <City>\n
        <CityId>1</CityId>\n
        <Name>South Park</Name>\n
    </City>\n
    <City>\n
        <CityId>2</CityId>\n
        <Name>Springfield</Name>\n
    </City>\n
    <City>\n
        <CityId>3</CityId>\n
        <Name>Quahog</Name>\n
    </City>\n
</List>
"""
DOMElement
array:2 [
  "CityId" => 1
  "Name" => "South Park"
]
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6