<?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;