#!/usr/bin/perl use warnings; use strict; use XML::LibXML; use XML::LibXSLT; my $xml_file = shift; my $xsl_file = shift; die unless ($xml_file and $xsl_file); my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $stylesheet = $xslt->parse_stylesheet_file( $xsl_file ); my $source_doc = $parser->parse_file( $xml_file ); my $result = $stylesheet->transform( $source_doc ); print $stylesheet->output_string( $result );