I used the following to delete an entire node using the child element:
<?php
$childElement->parentNode->parentNode-> removeChild($childElement->parentNode);
?>
I could not have thought of it without the help of everyone who contributed to this thread.
Thanks!
(I had to introduce the extra space between parentNode->removeChild to get rid of the wordwrap() warning while posting this note)