<?php
$note=<<<XML
<note>
<to>Afzall</to>
<from>Hasan</from>
<heading>Reminder</heading>
<body>Don't forget your parents</body>
</note>
XML;
$xmlIterator = new SimpleXMLIterator($note);
var_dump($xmlIterator->current()); //out put : NULL
var_dump($xmlIterator->rewind()); //out put null
$xmlIterator->rewind(); //beacse of rewind to first element then show "$xmlIterator->current()""
var_dump($xmlIterator->current());
//out put : object(SimpleXMLIterator)#2 (1) { [0]=> string(6) "Afzall" }
?>