/** * @param ChildNodeInterface $item * * @return $this */ public function remove($item) { if ($item->parent() === $this->parentNode) { $this->checkUnlocked($item); $item->internalUnsetParent(); parent::remove($item); } return $this; }