open 947833.xml ; for /servers/* echo name() ; # list stations for /servers/station18/ip echo text(); # list ip's for station18 $station = 'station17' ; for /servers/*[name()=$station]/ip echo text(); # list ip's for a station given by a string var