$ xsh --html --quiet --non-interactive --load pm981742.xsh

July 12

Tim

Jon

July 13

James

Eric

Jerry

Susie

July 14

Kami

Darryl

{ "July 12" => ["Tim", "Jon"], "July 13" => ["James", "Eric", "Jerry", "Susie"], "July 14" => ["Kami", "Darryl"], } #### open pm981742.xml; ls --indent /; for //body/* { $text = string(text()); if( name() = "h4" ){ $key = $text; } if( name() = "p" ){ perl { push @{ $hash{$key} }, $text; }; } } perl { use Data::Dump; dd \%hash; undef %hash; undef $key; };