If the mortgagee demands attorney fees in case of the sale of real estate under and by virtue of the power of sale contained in any mortgage or deed of trust in this state, except in case of the sale of real estate by virtue of a power of sale conferred upon a trustee under a trust indenture as defined in the Small Tract Financing Act of Montana, the mortgagee shall petition the district court of the county in which the real estate or any part of the real estate is situated to fix the amount of the attorney fees. A copy of the petition must be served upon all parties having or claiming an interest of record in the property to be sold or those parties that may be found within the state, at least 10 days before the day fixed for hearing. Notice of the time and place of the hearing must be served at the same time as the copy of the petition is served. A petition must be acted upon by the district court before the notice of sale by publication or posting, as provided for in this part, is given.
§ 71-1-234, MCA