As mentioned above, you need to set each tag to a non-prefixed version of itself.
_all_ triggers a handler on each tag, tag gives you the tag name and
set_tag sets it:
#!/usr/bin/perl
use strict;
use warnings;
use XML::Twig;
XML::Twig->new( start_tag_handlers => { _all_ => sub { my $tag= $_->ta
+g; $tag=~ s{^[^:]*:}{}; $_->set_tag( $tag); } },
keep_spaces => 1, # to keep for
+mating
)
->parse( \*DATA)
->print;
__DATA__
<a:houses>
<a:house>
<a:sq_footage/>
<a:address/>
</a:house>
<a:house>
<a:sq_footage/>
<a:address/>
</a:house>
</a:houses>