Type 1 value Type 2 value Type 1 value Type 2 value Type 5 value content 1 Some stuff #### #! /usr/bin/perl use strict; use warnings; use Data::Dumper; use Cwd; use Win32::OLE; use XML::Simple; my $file = 'dataFile.xml'; my $xs1 = XML::Simple->new(); my $doc = $xs1->XMLin( $file, keyattr=>['CLASSNAME'], ForceContent=>1 ); my %subroutines = %{$doc->{SUB}}; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add(); my $worksheet = $workbook->Worksheets(1); my $rowCount = 2; my $colCount = 2; my $colspan = 1; foreach my $this_routine ( sort keys %subroutines ) { my $element_count = scalar( keys %{$subroutines{$this_routine}} ); $worksheet->Cells($rowCount, $colCount)->{Value} = $this_routine; $rowCount++; foreach my $this_type (sort keys %{$subroutines{$this_routine}} ) { if ( exists $subroutines{$this_routine}-> {$this_type}->{Type}) { $worksheet->Cells($rowCount, $colCount)->{Value} = $this_type; $colCount++; } $rowCount--; }