in reply to merging XML file

moritzs suggestion apart (I haven't yet been to have a look), it looks (from slightly sparse evidence) like you want a simple merge of 2 (or maybe more) XML files, so why not ...
  1. Read each file into its own hash (using XMLin() from XML::Simple,
  2. Merge all the input hashes
  3. Finally, write the resultant hash using XMLout() (again from XML::Simple).
Assuming, of course, that the combined size of the input XML files isn't huge (and thus likely to cause the process to run out of memory).

A user level that continues to overstate my experience :-))