private function removeXPath(string $expression, callable $callback = null): self {
        $nodes = $this->document()->findXPath($expression);

        foreach ($nodes as $node) {
            if (is_null($callback) || $callback($node)) {
                $node->remove();
            }
        }

        return $this;
    }