du machst wohl was falsch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use XML::LibXML;
my $xc = XML::LibXML->new;
my $node = $xc->parse_string('<?xml version="1.0" encoding="UTF-8"?><xData><xID>28344</xID><mType>s</mType></xData>');
print $node->toString;
my $path = '//xID';
my $value = '123';
if (my $subnode = $node->findnodes($path)->[0]) {
$subnode->removeChildNodes();
$subnode->appendTextNode( $value );
}
print $node->toString;