use XML::Simple; my $inst_set = XMLin( 'test.xml', KeepRoot => 1 ); foreach my $Channel (@{$inst_set->{Settings}->{Channels}->{Channel}}) { if ( $Channel->{Voltage} ) { print "Old voltage: $Channel->{Voltage} -- "; $Channel->{Voltage} *= 2.0; print "New voltage: $Channel->{Voltage}\n"; } } my $xml = XMLout( $inst_set, KeepRoot => 1 ); print $xml;