protected function addUrlToDocument(array $urlArray)
    {
        if ($this->hasMaxUrlCount()) {
            throw new MaxUrlCountExceededException('Maximum number of URLs has been reached, cannot add more.');
        }

        $node = $this->document->createElement($this->getNodeName());

        foreach ($urlArray as $key => $value) {
            if (is_null($value)) {
                continue;
            }
            $node->appendChild(new DOMElement($key, $value));
        }
        $this->rootNode->appendChild($node);
        $this->urlCount++;

        return $this;
    }