\n"; //send first tag to print
$myCountry = $sxe->acountry->countryname; //place country into variable $myCountry
foreach($sxe->acountry->destination as $oneDest) //loop through destinations
{
$aDest = $oneDest->adestination; //put adestination into variable $aDest
foreach($oneDest->activities->activity as $oneAct) //loop through activities, each activity
{
$act = $oneAct;
$actCompare = $inputActivity; //put text field input to another variable
if($act==$actCompare) //compare input from text field to the current looped activity
{
print "
\n"; //print to screen the tag
print "
\n"; //print to screen the open tag, the data and the close tag
print "
\n"; //print to screen the open tag, data, close tag
foreach($oneDest->activities->activity as $oneAct) //loop through activities, each activity relevant to the search
{
$act = $oneAct;
print "
\n"; //print those relevant activities
}
}
}
}
}
print "
\n"; //print 'wrapper' tag
print "
\n"; //print final close tag
?>