Adds nodes before the character data.
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[world]]></container>");
$cdata = $doc->documentElement->firstChild;
$cdata->before("hello", $doc->createElement("beautiful"));
echo $doc->saveXML();
?>
The above example will output:
<?xml version="1.0"?>
<container>hello<beautiful/><![CDATA[world]]></container>