Firstly sex change operation is not allowed.
After that if the person has now 'become' male, passing urine from male organ then will be classified male, and vise versa
One must fast, take medication, be in proper enviroment, aviod evil company, be under spiritual guidance all the time.