public static function sanitizeQtiXml($qti)
    {
        $doc = self::loadQtiXml($qti);
        
        $xpath = new \DOMXpath($doc);
        
        foreach ($xpath->query("//*[local-name() = 'itemBody']//*[@style]") as $elementWithStyle) {
            $elementWithStyle->removeAttribute('style');
        }

        $ids = array();
        /** @var \DOMElement $elementWithId */
        foreach ($xpath->query("//*[not(local-name()='lib') and not(local-name()='module') and @id]") as $elementWithId) {
            $id = $elementWithId->getAttribute('id');
            if(in_array($id, $ids)){
                $elementWithId->removeAttribute('id');
            } else{
                $ids[] = $id;
            }
        }

        return $doc->saveXML();
    }