private function setAttributes(\DOMNode $domNode, TagNodeInterface $node, array $allowedAttributes = [])
    {
        if (!\count($domNode->attributes)) {
            return;
        }

        /** @var \DOMAttr $attribute */
        foreach ($domNode->attributes as $attribute) {
            $name = strtolower($attribute->name);

            if (\in_array($name, $allowedAttributes, true)) {
                $node->setAttribute($name, $attribute->value);
            }
        }
    }