private function getNodeValueAsText(\DOMNode $node)
    {
        $text = $node->ownerDocument->saveHTML($node);
        $text = str_replace(["<br>\n", "\n", '<br>'], ['<br>', ' ', "\n"], $text);

        return trim(strip_tags($text));
    }