src/SimpleDOM.php
public function removeSelf()
    {
        $tmp = dom_import_simplexml($this);

        if ($tmp->isSameNode($tmp->ownerDocument->documentElement)) {
            throw new BadMethodCallException('removeSelf() cannot be used to remove the root node');
        }

        $node = $tmp->parentNode->removeChild($tmp);
        return simplexml_import_dom($node, get_class($this));
    }
public function removeSelf()
    {
        $tmp = dom_import_simplexml($this);

        if ($tmp->isSameNode($tmp->ownerDocument->documentElement)) {
            throw new BadMethodCallException('removeSelf() cannot be used to remove the root node');
        }

        $node = $tmp->parentNode->removeChild($tmp);
        return simplexml_import_dom($node, get_class($this));
    }
Remove this node from document

This is a convenience method. The same result can be achieved with
<code>
$node->parentNode()->removeChild($node);
</code>

@throws BadMethodCallException
@return    SimpleDOM        The removed node