(a) In any in rem proceeding, if a person with an interest in a trust is a minor or an incapacitated person as defined in section 524.5-102 and has no conservator within the state, or if a person with an interest in a trust is unborn, unascertained, or a person whose identity or address is unknown and not reasonably ascertainable, the court shall represent that person, unless the court appoints a representative to represent the person.
(b) As to any other matter arising under this chapter, whether or not a judicial proceeding concerning the trust is pending, if the court determines that a person with an interest in a trust is not represented under sections 501C.0301 to 501C.0304, or that the otherwise available representation might be inadequate, the court may appoint a representative on behalf of such unrepresented person. The appointment of a representative pursuant to this section shall constitute a determination by the court that such appointment is appropriate.
(c) Any representative provided for in this section may be appointed upon application of the trustee or of any other person with an interest in a trust, or by the court on its own motion.
(d) In making decisions, the court or a representative, as the case may be, may consider general benefit accruing to the living members of the represented person's family.