Convert XML to Json in ZF2

Code
<?php

use Zend\Xml2Json\Xml2Json;
use 
Zend\Debug\Debug;

$xmlStr file_get_contents(__DIR__ '/city.xml');

$json Xml2Json::fromXml($xmlStr);

echo 
Debug::dump($xmlStrnullfalse);
echo 
$json;
Result
string(296) "<?xml version="1.0" encoding="UTF-8"?>
<List>
<City>
<CityId>1</CityId>
<Name>South Park</Name>
</City>
<City>
<CityId>2</CityId>
<Name>Springfield</Name>
</City>
<City>
<CityId>3</CityId>
<Name>Quahog</Name>
</City>
</List>"
{"List":{"City":[{"CityId":"1","Name":"South Park"},{"CityId":"2","Name":"Springfield"},{"CityId":"3","Name":"Quahog"}]}}
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6