Strange behavior of xml?

Generate xml using DOM

after a while the xml fray
What could it be?
<massage>0ۺQ<order&g< code></order&g<></massage>
July 9th 19 at 10:51
2 answers
July 9th 19 at 10:53
mini classic
class Xml extends \DOMImplementation
 public function __construct()
 $this->dom = $this->createDocument();
 $this->dom->encoding = 'utf-8';
 $this->dom->formatOutput = true;
 $this->dom->preserveWhiteSpace = false;

 function addElement($node, $name, $text = ")
 $element = $this->dom->createElement($name, $text);

 return $element;

 public function getDocument()
 return $this->dom->saveXML();

and a piece of generate an
$this->xml = new Xml();
$xmlMassage = $this->xml->addElement($this->xml->dom, 'Massage');

$xmlOrder = $this->xml->addElement($xmlMassage, 'Order');
$this->xml->addElement($xmlOrder, 'orderID', 416267);
return $this->xml->getDocument();

nothing supernatural
on another machine that is not shown
July 9th 19 at 10:55
version encoding server pages default on this and the other machines exactly the same?

Find more questions by tags PHPXML