how to iterate through xml data?

Looks like you would need to loop the XML object results, eg:

$comments = array();
foreach ($object->survey as $index => $survey) {
    if (is_string($survey->comments)) {$comments[$index] = $survey->comments;}
}
print_r($comments); // to see comments