The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!perl -w
use strict;
use XML::Records;

my $p=XML::Records->new('modules.xml') or die "$!";
$p->set_records('module');
while (my $record=$p->get_record()) {
  my $pkg=$record->{package};
  if (ref $pkg eq 'ARRAY') {
    for my $subpkg (@$pkg) {
      print $subpkg->{name},"\n";
    }
  }
  else {
    print $pkg->{name},"\n";
  }
}