Access data of Traversable with IteratorIterator

Code
<?php

$dom 
= new DOMDocument();
$dom->load(__DIR__ '/test.xml');

/* @var $nodeList DOMNodeList */
// DOMNodeList is Traversable, but not an Iterator
$nodeList $dom->getElementsByTagName('book');

$iterator = new IteratorIterator($nodeList);

// now it's usable like an iterator
$iterator->rewind();
// all childnode values of first book-node
echo $iterator->current()->nodeValue;
Result
Gambardella, Matthew
XML Developer's Guide
Computer
44.95
2000-10-01
An in-depth look at creating applications with XML.
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8