使用XSLT merge 2 XML,它来自PHP transformToXML

I am beginner in PHP, XSLT. Found solution for transform XML using XSLT:

$xml = Array2XML::createXML('Document', $result);
$xsl = new DOMDocument;
$xsl->load('Teema.xsl');
$processor = new XSLTProcessor();
$processor->importStyleSheet($xsl);
$results=$processor->transformToXML($xml);
$results=$processor->transformToUri($xml,"NewTeema.xml" );

But, what to do if I have 2 or more XMLs? This $xml is not file, and I dont want to save each xml, like file on server (because it is was converted response json). Any ideas?

In the XSLT you can load additional document using the document() function.

Another possibility is to register a PHP function that loads the file and returns the value or DOM node.

Good solution, but I decided to merge 2 json, like this: json_encode(array_merge(json_decode($result, true),json_decode($resultProducts, true))); And the use = Array2XML::createXML('Document', $result);