importStyleSheet($xsl); try { /** @var string|null|false $transform */ $transform = $xslt->transformToXML($xml); } catch (TransformationException $exception) { throw new XsltBuildException('Error while transforming the xslt content', 0, $exception); } if (null === $transform || false === $transform) { throw $this->createLibXmlErrorOrMessage('Error while transforming the xslt content'); } return $transform; } }