children[0]->children as $lookup) { if ($lookup->name=='row') $lookupTable[$lookup->attributes["input"]]=$lookup->attributes["output"]; } $questionArray=array(); foreach($xml->children[1]->children as $questions) { $tempQuestion=new Question(); $tempQuestion->title=$questions->children[0]->content; $tempQuestion->prompt=$questions->children[1]->content; $tempQuestion->genderSpecific=$questions->children[2]->content; $tempQuestion->controllable=$questions->children[4]->content; $tempQuestion->options=array(); foreach($questions->children[3]->children as $option) { $optionPrompt=$option->attributes["prompt"]; $RAEffect=$option->attributes["RA-effect"]; $tempQuestion->options[$optionPrompt]=$RAEffect; } $questionArray[]=$tempQuestion; } $_SESSION['questionArray']=$questionArray; $_SESSION['lookupTable']=$lookupTable; } ?>