How to create XML with XML::Twig containg a namespace declaration and prefixed names?
I am creating a new XML document from scratch using XML::Twig . The root element should have a prefix and a namespace declaration. All children should also belong to this namespace and use this prefix. The output should be something like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <abc:root xmlns:abc="http://www.somehost.com/abc-data/ns/5.0.0" version="5.0.0.0"> <abc:element name="myElement"> This is my element </abc:element> </abc:root> I suppose it would look somewhat like this: my $new_twig = XML::Twig->new(map_xmlns => {'http://www.somehost.com/abc-data/ns/5.0.0' => "abc"}