Appends nodes in the container element.
<?php
$doc = new DOMDocument;
$doc->loadXML("<container>hello </container>");
$world = $doc->documentElement;
$world->append("beautiful", $doc->createElement("world"));
echo $doc->saveXML();
?>
The above example will output:
<?xml version="1.0"?>
<container>hello beautiful<world/></container>