php: displaying titles and images of rss feed using xPath
===

I'm trying to get the titles and images of an rss feed to display using xpath in php. But it is only displaying 1 title. All the titles are not displaying and none of the images are getting displayed. My code:

    function getImage($xml){
		$items=$xml->xPath('/rss/channel/item');
		foreach($items as $item){
		    echo($item->title);
			$encl=$xml->xPath('//enclosure');
			print_r('<img src='.$encl->attributes()->url.'/>');
			echo('<br>');
		}

Can someone point out on where i'm going wrong? Thank you.