public function replaceAll($selector)
{
$result = $this->applyToSpawn($targetNodes = $this->build()->getTargetNodes($selector), $this->_nodes, function ($targetNode, $contentNodes) {
return $this->modify($targetNode)->insertNodesBefore($contentNodes);
}, TRUE);
$target = $this->spawn($targetNodes);
$target->remove();
return $result;
}