my %xmlData;
$xmlData{'Date'}='2018-10-15';
$xmlData{'Time'}='18:20:00';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Type'} = 'D';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'ImportID'} = '123;
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Reference'} = 'RefNo';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Number'} = 'ShipNo';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Lifts'} = '3';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Weight'} = '1800';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'ManifestNote'} = 'Freight to load';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'CollectionDate'} = '2018-10-15';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'DeliveryDate'} = '2018-10-17';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'DeliveryTime'} = '15:00:00';
[...] Code between [...]
$xmlData{'Depot'}{'Account'}{'Consignment'}{'Pallet'}='PID_987654';
$xmlData{'Depot'}{'Account'}{'Consignment'}{'BillUnit'}{'Type'}='QP'?
$xmlData{'Depot'}{'Account'}{'Consignment'}{'BillUnit'}{'Amount'}='3';
####
my $xml = new XML::Simple;
my $xmlout = $xml -> XMLout(\%xmlData, NoAttr => 1, RootName => 'Manifest', KeyAttr => 'Account', NoSort => 1, SuppressEmpty => undef );
$xmlout = ''."\n".$xmlout;
####
Account
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]