#!/usr/bin/perl use strict; use warnings; use XML::Simple; my $xml_file = '24845_2874846.fmd'; my $xml = XMLin( $xml_file, KeepRoot => 1, ForceArray => 1, ); $xml->{importrecord}->[1]->{aktionen}->[0]->{transaktion}->[0]->{parameter}->[0]->{aktion}->[0]->{attribut}->[0] = 'Anlegen'; XMLout( $xml, KeepRoot => 1, NoAttr => 1, OutputFile => $xml_file, );