http://www.perlmonks.org?node_id=837954


in reply to Re: XML::Twig Text replacement
in thread XML::Twig Text replacement

Actually you can handle namespaces in XML::Twig, using the map_xmlns option. I am not sure it's worth doing in this case though (and it might be a good example of why I dislike seemingly gratuitous default namespaces, they just make processing harder while providing exactly 0 added value).

Also, if you use the id => 'Id' option in the new, you can then write $Id= $_->id and $_->set_id( $CsID); which I think is slighty clearer, and has the added benefit, if need be, to let you access an element directly through its id, using the elt_id method.