in reply to XML::Twig issues

Well, it is going to be hard for me to debug your code if you give me data that doesn't exhibit the problem you describe. You should really try to extract the smallest data set that causes the problem and work from there.

I have a few comment son your code, but nothing that should prevent it from working: