public function saveXml($formatted = false)
{
// Return a complete document including XML prologue.
$doc = new DOMDocument($this->_element->ownerDocument->version, $this->_element->ownerDocument->actualEncoding);
$doc->formatOutput = $formatted;
$doc->appendChild($doc->importNode($this->_element, true));
return $doc->saveXML();
}