document_element(); $rootchilds = $root->child_nodes(); foreach ($rootchilds as $rootchild) { if ($rootchild->tagname == "channel") { $channelchilds = $rootchild->child_nodes(); foreach ($channelchilds as $channelchild) { if ($channelchild->tagname == "item") { $itemchilds = $channelchild->child_nodes(); $newsdata = array(); foreach ($itemchilds as $itemchild) { if (strlen($itemchild->tagname) > 0) { $newsdata[$itemchild->tagname] = $itemchild->get_content(); } } print_news_item($newsdata); } } } } function print_news_item($newsdata) { echo '
' . $newsdata['description'] . '