PHP XSLTProcessor

Code
<?php

$xslStr 
'<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <h1>List of cities</h1>
  <ul>
    <xsl:for-each select="List/City">
    <li>city</li>
    <ul>
      <li><xsl:value-of select="CityId"/></li>
      <li><xsl:value-of select="Name"/></li>
    </ul>
    </xsl:for-each>
  </ul>
  </body>
  </html>
</xsl:template>

<xsl:output method="html" version="5.0" doctype-system="about:legacy-compat" />

</xsl:stylesheet>'
;

$xsl = new DOMDocument();
$xsl->loadXML($xslStr);

$xml = new DOMDocument();
$xml->load(__DIR__ '/city.xml');

$p = new XSLTProcessor();
$p->importStylesheet($xsl);

$xml $p->transformToXML($xml);

echo 
$xml;
Result
<!DOCTYPE html>
<html><body>
<h1>List of cities</h1>
<ul>
<li>city</li>
<ul>
<li>1</li>
<li>South Park</li>
</ul>
<li>city</li>
<ul>
<li>2</li>
<li>Springfield</li>
</ul>
<li>city</li>
<ul>
<li>3</li>
<li>Quahog</li>
</ul>
</ul>
</body></html>
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8