public function outerXml($xml = NULL) { return $this->outerContent($xml, function ($node) { return $this->getDocument()->saveXML($node); }, function ($xml) { return $this->build()->getFragment($xml, 'text/xml', TRUE); }); }