\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 "" . $myCountry . "
\n"; //print to screen the open tag, the data and the close tag print "" . $aDest . "
\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 "" . $act . "
\n"; //print those relevant activities } } } } } print "

\n"; //print 'wrapper' tag print "
\n"; //print final close tag ?> Search for an activity Search for an activity:-
Try 'Sailing'