The child is getting pain on defecation because the hard stools that are passed has caused a tear which is known as Fissure in Ano
Please give her 30 ml (6 teaspoonful) of Liquid Paraffin every night. This can be mixed with food /dal etc. This will result in the hard stools slipping out without causing pain
Next Steps
Local application of LOX jelly 2% to be done 5 - 10 minutes before she passes stool. This is an anesthetic gel and will make the part numb. If she does not have pain, she will pass stools freely
Health Tips
Once stool is passed freely, she will start eating also. She must get a high fibre diet in the form of green vegetables and fruits. Please consult a Pediatric Surgeon and have the child examined for proper treatment