public function deleteSelf()
    {
        $tmp = dom_import_simplexml($this);

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

        $tmp->parentNode->removeChild($tmp);
    }