<?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;