protected static function removeChild(\DOMNode $node, $tag)
 {
     try {
         $list = $node->getElementsByTagname($tag);
         foreach ($list as $element) {
             $element->parentNode->removeChild($element);
         }
     } catch (\DOMException $e) {
         \error_log('Element <' . $tag . '> not found: ' . $e->getMessage() . "\nHTML:" . static::toHtml($node), 4);
     }
     return $node;
 }