protected function getOptionalNodeAttribute(\DOMNode $node, $name, $default = null)
    {
        $attribute = $node->attributes->getNamedItem($name);
        if ($attribute) {
            return $attribute->nodeValue;
        }

        return $default;
    }