private function removeAttributes(\DOMNodeList $elems, $logMessage = null)
    {
        if (null !== $logMessage) {
            $this->logger->info($logMessage, ['length' => $elems->length]);
        }

        foreach ($elems as $el) {
            $owner = $el->ownerElement;
            $owner->removeAttributeNode($el);
        }
    }