in reply to xml help

XML::Simple is not really a good XML parser.

That said, you want to look at the KeepRoot option:

#!perl -w use strict; use XML::Simple; my $xs = XML::Simple->new( KeepRoot => 1, ); my $ref = $xs->XMLin("<say>Hello world!</say>"); my $xml = $xs->XMLout($ref); print $xml; exit;

Replies are listed 'Best First'.
Re^2: xml help
by jellisii2 (Hermit) on Dec 11, 2014 at 18:43 UTC
    an XML::Twig example to help bootstrap you:

    use strict; use warnings; use XML::Twig; my $twig = new XML::Twig('pretty_print' => 'indented'); $twig->safe_parse('<say/>'); my $root = $twig->root(); $root->set_text('Hello World'); $twig->print();

    The fine documentation should be read if you're going to use it. I haven't met a problem with XML that twig couldn't handle though.
Re^2: xml help
by bigup401 (Pilgrim) on Dec 11, 2014 at 19:27 UTC
    Thanks guys, both solution worked for me