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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)