Added logic for parsing xml files