XML Tag Names With Hyphens in PHP

Suppose a tag name contains a hyphen:

test.xml<root>
  <tag>
    <elem-child>text</elem-child>
  </tag>
</root>

In this case, to access such a tag, you will need to use the following technique:

php<?php
  echo $xml->tag->{'elem-child'}; // 'text'
?>
Задание 1

Given the following XML:

html<root>
  <user-name>john</user-name>
  <user-surn>smit</user-surn>
</root>

Display the user's first and last name on the screen.