XML Writer
$xw = new xmlWriter();
$xw->openMemory();
$xw->setIndent(true);
$xw->startDocument('1.0','UTF-8');
$xw->startElement('node');
$xw->text('qwe!@£$%^&*∞¢#€qwe');
$xw->endElement();
$xw->writeElement("quantity", 'qwe!@£$%^&*qwe');
$xw->writeElement("price_per_quantity", 'qwe!@£$%^&*qwe');
echo $xw->outputMemory(true);
echo PHP_EOL;
$xw->openMemory();
$xw->setIndent(true);
$xw->startDocument('1.0','UTF-8');
$xw->startElement('node');
$xw->text('qwe!@£$%^&*∞¢#€qwe');
$xw->endElement();
$xw->writeElement("quantity", 'qwe!@£$%^&*qwe');
$xw->writeElement("price_per_quantity", 'qwe!@£$%^&*qwe');
echo $xw->outputMemory(true);
echo PHP_EOL;
REFERRERS
PhpXml