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 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6