The court on its own motion may, or on petition of any party in interest shall, appoint a trustee ad litem or guardian ad litem, as may be appropriate, in accordance with general rules.