Based on the getElementsByTagName call, I'm assuming you're using XML::DOM to parse your xml. If that's the case, here's an example of returning the text within the name elements which are within owned elements.