update to make code more meaningful and improving overall efficiency

XML::XPath module of Perl is pathetically slow. So, switching to csv.