public function load($removeUnfoundHref = false){

        $xincludes = $this->getXIncludes();
        
        //load xincludes in standard element
        foreach($xincludes as $xinclude){
            //retrive the xinclude from href
            $href = $xinclude->attr('href');
            if(!empty($href)){
                try {
                    $asset = $this->resolver->resolve($href);
                    $filePath = $asset->getMediaSource()->download($asset->getMediaIdentifier());
                    $this->loadXInclude($xinclude, $filePath);
                } catch (\tao_models_classes_FileNotFoundException $exception) {
                    if ($removeUnfoundHref) {
                        $xinclude->attr('href', '');
                    } else {
                        throw new XIncludeException('The file referenced by href does not exist : '.$href, $xinclude);
                    }
                }
            }
        }
        
        //load xinclude in portable element markup
        $customElements = $this->getCustomElements();
        foreach($customElements as $customElement){
            $xincludes = array_merge($xincludes, $this->parseCustomElementMarkup($customElement));
        }

        return $xincludes;
    }