#!/usr/bin/perl use warnings; use strict; use SOAP::Lite; my $xml = <<'eof'; eof my $som = SOAP::Deserializer->deserialize($xml); for my $item ($som->dataof("/Envelope/Body/command/*")) { print "got 'command' item '", $item->name(), "'\n"; my $i = 1; for my $subitem ($som->dataof("/Envelope/Body/command/[$i]/*")) { print "got 'command' subitem $i '", $subitem->name(), "'\n"; my $j = 1; for my $subsubitem ($som->dataof("/Envelope/Body/command/[$i]/[$j]/*")) { print "got 'command' subsubitem $i:$j '", $subsubitem->name(), "'\n"; $j++; } $i++; } }