private function addResumptionToken(ResultListInterface $resultList, $listNode)
    {
        // @TODO Add support for expirationDate

        $resumptionTokenNode = null;

        if ($resultList->getResumptionToken()) {
            $resumptionTokenNode = $this->response->createElement('resumptionToken', $resultList->getResumptionToken());
        } elseif ($resultList->getCompleteListSize() !== null || $resultList->getCursor() !== null) {
            // An empty resumption token with attributes completeListSize and/or cursor.
            $resumptionTokenNode = $this->response->createElement('resumptionToken');
        }

        if ($resultList->getCompleteListSize() !== null) {
            $resumptionTokenNode->setAttribute('completeListSize', $resultList->getCompleteListSize());
        }

        if ($resultList->getCursor() !== null) {
            $resumptionTokenNode->setAttribute('cursor', $resultList->getCursor());
        }

        if ($resumptionTokenNode !== null) {
            $listNode->appendChild($resumptionTokenNode);
        }
    }