private function buildCustomInteraction(DOMElement $data){

        $interaction = null;

        $pciClass = $this->getPciClass($data);

        if (!empty($pciClass)) {

            $ns = null;
            foreach($this->item->getNamespaces() as $name => $uri){
                if($pciClass::NS_URI === $uri){
                    $ns = new QtiNamespace($uri, $name);
                }
            }
            if(is_null($ns)){
                $pciNodes = $this->queryXPathChildren(array('portableCustomInteraction'), $data);
                if($pciNodes->length){
                    $ns = new QtiNamespace($pciNodes->item(0)->getAttribute('xmlns'));
                }
            }

            //use tao's implementation of portable custom interaction
            $interaction = new $pciClass($this->extractAttributes($data), $this->item);
            $interaction->feed($this, $data, $ns);
        }else{

            $ciClass = '';
            $classes = $data->getAttribute('class');
            $classeNames = preg_split('/\s+/', $classes);
            foreach($classeNames as $classeName){
                $ciClass = CustomInteractionRegistry::getCustomInteractionByName($classeName);
                if($ciClass){
                    $interaction = new $ciClass($this->extractAttributes($data), $this->item);
                    $interaction->feed($this, $data);
                    break;
                }
            }

            if(!$ciClass){
                throw new ParsingException('unknown custom interaction to be build');
            }
        }

        return $interaction;
    }