private function loadXml(\core_kernel_classes_Resource $item)
    {
        $itemService = Service::singleton();

        try {
            $xml = $itemService->getXmlByRdfItem($item);
            if (empty($xml)) {
                throw new ExtractorException('No content found for item ' . $item->getUri());
            }
        } catch (FileNotFoundException $e) {
            throw new ExtractorException('qti.xml file was not found for item '. $item->getUri() .'; The item might be empty.');
        }

        $this->dom   = new \DOMDocument();
        $this->dom->loadXml($xml);
        $this->xpath = new \DOMXpath($this->dom);
        $this->xpath->registerNamespace('qti', $this->dom->documentElement->namespaceURI);

        return $this;
    }