3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $root = new DOMDocument(); $root->loadXML('<article id=""></article>'); $node = new DOMDocument(); $node->loadXML('<section><h1>Überschrift1</h1><h1>Überschrift2</h1><p></p></section>'); $node = $root->importNode($node->documentElement, true); $root->documentElement->appendChild($node); print $root->saveXML();
based on ntNeb
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
<?xml version="1.0"?> <article id=""><section><h1>&#xDC;berschrift1</h1><h1>&#xDC;berschrift2</h1><p/></section></article>