public function setRemoved($removed)
{
if (!$this->isNodeDataMatchingContext()) {
$this->materializeNodeData();
}
if ((bool) $removed === true) {
/** @var $childNode Node */
foreach ($this->getChildNodes() as $childNode) {
$childNode->setRemoved(true);
}
$this->nodeData->setRemoved(true);
$this->emitNodeRemoved($this);
} else {
$this->nodeData->setRemoved(false);
$this->emitNodeUpdated($this);
}
$this->context->getFirstLevelNodeCache()->flush();
}