Texts of XML Tags Group in PHP

Suppose now in XML we have several tags:

test.xml<root>
  <tag>text1</tag>
  <tag>text2</tag>
  <tag>text3</tag>
</root>

Now the property $xml->tag will store an iterable object:

index.php<?php
  var_dump($xml->tag); // iterable object
?>

Let's iterate over our iterable object with a loop and output the values of our tags:

index.php<?php
  foreach ($xml->tag as $tag) {
    echo $tag; // 'text1', 'text2', 'text3'
  }
?>
Задание 1

Given the following XML:

html<root>
  <name>john</name>
  <name>eric</name>
  <name>kyle</name>
</root>

Display each user's name on the screen.