public function generate_metadata($lom_identifier, $res)
    {
        debug_message('****** In '.__FILE__.' function '.__FUNCTION__.' was called.');
        $lom_data = new LOM_DataHolder();
        $lom_data->setIdentifiers($lom_identifier, $this->def_catalog);
        //debug_var_dump('lom_data->lomdata', $lom_data->lomdata['general']);
        //debug_var_dump('result', $res->fetch(PDO::FETCH_OBJ));
        $res->setFetchMode(\PDO::FETCH_CLASS, LOM_DataHolder::getKlass());

        while ($row = $res->fetch()) {
            //  debug_var_dump('lom_data', $lom_data);
            // debug_var_dump('query row', $row);
            $lom_data->combine($row);
        }
        $res->closeCursor();
        //debug_var_dump('lom_data', $lom_data);
        //write metadata to XML
        $this->write_xml_meta($lom_data->to_array());
    }