Read Multiple Children with Same Name with PHP SimpleXML

<?php 

$s = '<?xml version="1.0" encoding="UTF-8"?>
<student>
    <id>st01</id>
	<name>Name 1</name>
	<email>a@gmail.com</email>
    <email>b@gmail.com</email>
    <email>c@gmail.com</email>
    <email>d@gmail.com</email>
</student>
';

$student = simplexml_load_string($s);

echo 'id: ' .$student->id;
echo '<br>name: ' .$student->name;
foreach($student->email as $email) {
    echo '<br>'.$email;
}

?>
id: st01
name: Name 1
a@gmail.com
b@gmail.com
c@gmail.com
d@gmail.com