public static function getResourcesFromManifest( SimpleXMLElement $source)
    {
        $returnValue = array();

		//check of the root tag
		if($source->getName() != 'manifest'){
			throw new ParsingException("incorrect manifest root tag");
		}
			
		$resourceNodes = $source->xpath("//*[name(.)='resource']");
		foreach($resourceNodes as $resourceNode){
            
			$type = (string) $resourceNode['type'];
			if(Resource::isAssessmentItem($type)){
					
				$id = (string) $resourceNode['identifier'];
				$href = (isset($resourceNode['href'])) ? (string) $resourceNode['href'] : '';
					
				$auxFiles = array();
                
                //parse for auxiliary files
				foreach($resourceNode->file as $fileNode){
					$fileHref = (string) $fileNode['href'];
                    if($href != $fileHref){
                        $auxFiles[] = $fileHref;
                    }
				}
				
                //include dependency files in item
                foreach($resourceNode->dependency as $dependencyNode){
                    $ref = (string) $dependencyNode['identifierref'];
                    //find referenced files within the current manifest:
                    $refResourceNodes = $source->xpath("//*[name(.)='resource' and @identifier='".$ref."']");
                    foreach($refResourceNodes as $refResourceNode){
                        if(isset($refResourceNode['href'])){
                            $auxFiles[] = (string) $refResourceNode['href'];
                        }
                    }
                }
                
				$resource = new Resource($id, $type, $href);
				$resource->setAuxiliaryFiles($auxFiles);
					
				$returnValue[] = $resource;
			}
		}

        return (array) $returnValue;
    }