HI Sadhana,
As per my knowledge, as this is the case of 'Acquisition of Business', so regarding this a detailed info you can get from Accounts book (of CA Final).
They both can enter into 'Acquisition Agreement' or 'Agreement for Sale of Business of XYZ P. Ltd.'
As these both are Companies, procedure under Co. Act (i.e. consent of shareholders, resolutions etc.) will have to be followed.
I don't think there will be any bad implication on registered agreements of XYZ P. Ltd since after acquisition, all the legal matters will be routed to ABC P. Ltd. It is assumed that both the companies will properly communicate this fact to all statutory bodies. Hence, all future correspondence will be made to ABC P. Ltd. All financial transactions, accounting treatments will be made in books of ABC P. Ltd.
Last - Im not an expert in this but I have handled one of such case. Hence, if im wrong kindly rectify me.