/**
  * export page objects to xml (see ilias_co.dtd)
  *
  * @param	object		$a_xml_writer	ilXmlWriter object that receives the
  *										xml data
  */
 function exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog, $questions)
 {
     global $ilBench;
     include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
     foreach ($questions as $question_id) {
         $ilBench->start("ContentObjectExport", "exportPageObject");
         $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $question_id);
         $attrs = array();
         $a_xml_writer->xmlStartTag("PageObject", $attrs);
         // export xml to writer object
         $ilBench->start("ContentObjectExport", "exportPageObject_XML");
         include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
         $page_object = new ilAssQuestionPage($question_id);
         $page_object->buildDom();
         $page_object->insertInstIntoIDs($a_inst);
         $mob_ids = $page_object->collectMediaObjects(false);
         require_once 'Services/COPage/classes/class.ilPCFileList.php';
         $file_ids = ilPCFileList::collectFileItems($page_object, $page_object->getDomDoc());
         $xml = $page_object->getXMLFromDom(false, false, false, "", true);
         $xml = str_replace("&", "&", $xml);
         $a_xml_writer->appendXML($xml);
         $page_object->freeDom();
         unset($page_object);
         $ilBench->stop("ContentObjectExport", "exportPageObject_XML");
         // collect media objects
         $ilBench->start("ContentObjectExport", "exportPageObject_CollectMedia");
         //$mob_ids = $page_obj->getMediaObjectIDs();
         foreach ($mob_ids as $mob_id) {
             $this->mob_ids[$mob_id] = $mob_id;
         }
         $ilBench->stop("ContentObjectExport", "exportPageObject_CollectMedia");
         // collect all file items
         $ilBench->start("ContentObjectExport", "exportPageObject_CollectFileItems");
         //$file_ids = $page_obj->getFileItemIds();
         foreach ($file_ids as $file_id) {
             $this->file_ids[$file_id] = $file_id;
         }
         $ilBench->stop("ContentObjectExport", "exportPageObject_CollectFileItems");
         $a_xml_writer->xmlEndTag("PageObject");
         //unset($page_obj);
         $ilBench->stop("ContentObjectExport", "exportPageObject");
     }
 }