#! /usr/bin/env perl use strict; use warnings; use XML::Quick; use XML::Smart; # Bereite Datenstruktur vor my %hash = ( urlset => { url => [ { loc => "http://www.example.com/page1.html", lastmod => "2013-11-20", }, { loc => "http://www.example.com/page2.html", lastmod => "2013-11-21", }, ], }, ); # neue Sitemap auf Basis der Datenstruktur; xml() stammt von XML::Quick; siehe perldoc XML::Quick my $sitemap = XML::Smart->new(xml(\%hash)); # und raus damit: print $sitemap->data(), "\n"; __END__