<?php
$data = '<Students>
  <Student Name= Gender= DateOfBirth= />
  <Student Name= Gender=  DateOfBirth= />
  <Student Name= Gender=  DateOfBirth= />
  <Student Name= Gender=  DateOfBirth=>
    <Pet Type= Name= />
  </Student>
  <Student DateOfBirth= Gender= Name= />
</Students>';
$xml = new XMLReader();
$xml->xml( $data );
while ( $xml->read() )
	if ( XMLREADER::ELEMENT == $xml->nodeType && $xml->localName == 'Student' )
		echo $xml->getAttribute('Name') . ;
?>