in reply to xml tag mapping?

if(keys %hash == keys %hash1) {
This check is pointless since you have not initialized either hash. Prove it to yourself by printing their contents
print Dumper(\%hash); print Dumper(\%hash1); if(keys %hash == keys %hash1) {
The check will always pass:
use strict; use warnings; my %hash; my %hash1; if (keys %hash == keys %hash1) { print "eq\n"; } else { print "neq\n"; } __END__ eq
I have no idea if this is related to your problem since I do not understand your question. Using punctuation and capitalization in your English sentences would help to clarify.