header("Content-Type: text/html; charset=utf8");
     foreach (simplexml_load_string($xml) as $img) {
    $loc = $img->loc;
    $cap = $img->image->caption;
    $title = $img->image->title;

    }
Şunuda bir dene hocam olucak gibi duruyor.

Örnek olması açısından şu koduda gösterim nacizane.

header("Content-Type: text/html; charset=utf8");
    $dosya = 'http://www.f5haber.com/rss/haberler.xml';
    $a = simplexml_load_file($dosya);
    foreach ($a as $val) {
        foreach ($val->item as $haber) {

      
            
            echo $haber->title.'<br>';
            echo $haber->link.'<br>';
            echo $haber->description.'<br>';
            echo $haber->category.'<br>';
            echo $haber->pubDate.'<br>';
            echo $haber->img.'<br>';
            echo '<br>';
        }
        
    }