public function getXml()
{
if (!$this instanceof Appendable) {
throw new \LogicException(sprintf('Class %s does not implement the FluentDOM\\Appendable interface.', is_object($this) ? get_class($this) : ''));
}
$dom = new Document();
$fragment = $dom->appendElement('fragment');
$this->appendTo($fragment);
$xml = '';
foreach ($dom->documentElement->childNodes as $node) {
$xml .= $node->ownerDocument->saveXml($node);
}
return $xml;
}