It would be a misguidance if A is advised to withdraw the suit.
If A withdraws the suit then he may not have any ground to claim his property from the builder.
The builder should have executed the registered sale deed in favor A long ago, whereas due to some reasons this could happen till now hence A as approached court with suit for declaration of his title based on the sale agreement and also on payment of the full sale consideration amount to the builder.
Hence it may not be advisable for A to withdraw the suit because he will be never be able to claim rights or interest over this property and he would miserably fail to fulfill his commitment to X in this regard