/**
  * Removes a node from the childNodes list of the current node
  * @param Object The node to be removed
  * @return Object The removed node
  */
 function &removeChild(&$oldChild)
 {
     if ($this->documentElement != null && $oldChild->uid == $this->documentElement->uid) {
         parent::removeChild($oldChild);
         $this->documentElement = null;
     } else {
         parent::removeChild($oldChild);
     }
     $oldChild->clearReferences();
     return $oldChild;
 }
 /**
  * Removes a node from the childNodes list of the current node
  * @param Object The node to be removed
  * @return Object The removed node
  */
 function &removeChild(&$oldChild)
 {
     if ($this->nodeType == DOMIT_DOCUMENT_FRAGMENT_NODE) {
         $total = $oldChild->childCount;
         for ($i = 0; $i < $total; $i++) {
             $currChild =& $oldChild->childNodes[$i];
             $this->removeChild($currChild);
         }
     } else {
         if ($this->documentElement != null && $oldChild->uid == $this->documentElement->uid) {
             parent::removeChild($oldChild);
             $this->documentElement = null;
         } else {
             parent::removeChild($oldChild);
         }
     }
     $oldChild->clearReferences();
     return $oldChild;
 }