The court must appoint a guardian ad litem to represent the interest of such ward upon such hearing, as provided by law for the appointment of guardians ad litem in such court. The person so appointed such guardian ad litem must deny in writing the allegations of such report and resist the confirmation of such sale, and, if necessary, must, with the approval of the court, employ counsel to defend the interest of the person he so represents. He is entitled to reasonable compensation, and an allowance for reasonable fees of such counsel as he may so employ, to be fixed by the court and taxed and collected as costs in the action.