<?php
$xslt = new XSLTProcessor();
$xslDoc = new DOMDocument();
$xslDoc->loadXML('<?xml version="1.0" encoding="UTF-8"?>'."\n".
                 '<xsl:stylesheet'.
                     ' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"'.
                     ' version="1.0">'.
                 '<xsl:output method="text" encoding="UTF-8"/>'.
                 '<xsl:template match="/">'.
                     'Liste des sites web contenus dans le fichier XML:'.
                     '<xsl:apply-templates/>'.
                 '</xsl:template>'.
                 '<xsl:template match="siteweb">'.
                     '<xsl:value-of select="nom"/>:<xsl:value-of select="url"/>'.
                 '</xsl:template>'.
                 '</xsl:stylesheet>');
$xslt->importStylesheet($xslDoc);
$xmlDoc = new DOMDocument();
$xmlDoc->loadXML('<?xml version="1.0"?>'."\n".
                 '<racine><siteweb>'.
                 '<nom>PHP Facile!</nom>'.
                 '<url>http://www.phpfacile.com</url>'.
                 '</siteweb></racine>');
echo $xslt->transformToXML($xmlDoc);
?>