use strict; use warnings; use XML::LibXML; my $file = shift || die "Give me your XML file\n"; my $doc = XML::LibXML->new->parse_file($file); # Do your processing. It's not hard if you read the docs thoroughly. $doc->toFile($file);