my $data = do { local( $/ ) ; <$XmlFile> } ; # Slurp file
$data =~ s!(^\s*)?\<(TotalAmount|NoOfRecords|TotalBatch|CurrentBatch|E
+ODTransactionDate|BankFileSeqNo|TotAmount)\>(.+?)\<\/\1\>\n?!!mig;
+# Zap headers
$data =~ s!(^\s*)?</?.*?>\n?!!mig; # Zap xml tags
CRC32($data); # CRC remaining data
Should be fast, but in general regex'ing x/html is fragile and NOT recommended.
(implicit assumptions about the data content is one of the traps, -- which may/not apply in your case).
You probably should use XML::Twig instead!