protected function createListItem($class, $text)
    {
        $li = new NodeElement();
        $li->openTag('li')
           ->addAttribute('class', $class)
           ->finalize(false);

        if ($text !== null) {
            $li->setText($text);
        }

        return $li->closeTag();
    }