Suppose I am trying to read a XML feed with the following code:

<title>News Title</title>
<a href="">
<img src="" />
News story description
<media:content url="">
The following is the PHP code used to read the XML file.

PHP Code:
$xml simplexml_load_file($xml_url);
$namespaces $xml->getNamespaces(true); // get namespaces

foreach ($xml->channel->item as $item) {

"Link: "$item->link ."<br>";
"Title: "$item->title ."<br>";
"Description: "$item->description ."<br>";

$thumbnail = @$item->children($namespaces['media'])->content->attributes()->url;

  if (
$thumbnail != "") {
"Media: "$thumbnail  ."<br>";

In the description tag, how do I go about just retrieving the text section ("News story description") from within CDATA? I am not after the image tag or the link, which I can get from the media:content tag.

I had a quick look and it appears like xpath is one way to do it ( but I am unclear of how to use xpath in PHP.