A trustee, including a former trustee, is entitled to the repayment, out of the trust property, of all expenses actually and properly incurred by the trustee in the performance of the trustee's duties. The trustee is entitled to the repayment of even unlawful expenditures, if the expenditures were productive of actual benefit to the estate. Expenses in performance of the trust include those expenses actually and properly incurred in the exercise of the trustee's powers as described in the governing instrument, in any applicable court order, or in chapter 55-1A. A former trustee is entitled to the repayment, out of trust property, of all expenses actually and properly incurred by the former trustee in the defense of proceedings relating to the performance of the trustee's duties to the same extent as the current trustee is entitled to repayment.
SDCL 55-3-13