I have this xml document and knowing the name, I want to get the id:
<?xml version="1.0" encoding="UTF-8"?>
<menu defaultLang="ro" lastId="38">
<item>
<id>1</id>
<active>1</active>
<name>
<ro>Categories</ro>
</name>
<path>
<ro>categories</ro>
</path>
<children>
<item>
<id>23</id>
<active>1</active>
<name>
<ro>Proteins</ro>
</name>
<path>
<ro>proteins-masa</ro>
</path>
<children></children>
<image>Imag1.png</image>
</item>
<item>
<id>38</id>
<active>1</active>
<name>
<ro>Promotii</ro>
</name>
<path>
<ro>promotii</ro>
</path>
<children></children>
<image>promotions.png</image>
</item>
</children>
</item>
</menu>
I don't know how to work with xml files, so I need an example of a php function that returns the id of the item with name=Promotii from this document. Of course, my original file has more items, but here is the part that I'm interested in. My file is called menu.xml
Thank you!