public function remove(DOMElement &$element)
    {
        if (empty($element->parentNode)) {
            throw new DOMException('The current DOMItem has no parent.');
        }

        // Remove the element
        $element->parentNode->removeChild($element);
    }