What are the differences in handling XML feeds between PHP versions 4 and 5?

In PHP version 4, handling XML feeds required using the DOM XML extension, which has been deprecated since PHP 5.0 and removed in PHP 5.3. In PHP 5, handling XML feeds can be done using the DOM extension, which provides a more efficient and robust way to parse and manipulate XML documents.

// PHP 5 code to handle XML feeds using the DOM extension
$xml = new DOMDocument();
$xml->load('feed.xml');
$items = $xml->getElementsByTagName('item');
foreach ($items as $item) {
    $title = $item->getElementsByTagName('title')->item(0)->nodeValue;
    $link = $item->getElementsByTagName('link')->item(0)->nodeValue;
    // Process each item
}