1 package Catalyst::Action::Serialize::XML::Simple;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
10 my ( $controller, $c ) = @_;
16 $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@")
20 my $xs = XML::Simple->new(ForceArray => 0,);
23 $controller->{'serialize'} ?
24 $controller->{'serialize'}->{'stash_key'} :
25 $controller->{'stash_key'}
27 my $output = $xs->XMLout({ data => $c->stash->{$stash_key} });
28 $c->response->output( $output );