Getting XML value

This is probably very simple but I’m not sure what to google

if I have an XML file like

<myXML>
  <test id="test1" />
  <test id="test2" />
</myXML>

how do I access the id value from the test node?