$schema->template('PERL', $type); #warn $schema->template('PERL', $type); my $doc = XML::LibXML::Document->new('1.0', 'UTF-8'); my $write = $schema->compile(WRITER => $type, use_default_namespace => 1); my %hash; #some filling of the hash with values my $xml = $write->($doc, $hash); $doc->setDocumentElement($xml);