If during the pendency of an action for divorce the defendant is incapacitated by reason of mental illness, the court shall appoint a suitable guardian to appear and answer in like manner as a guardian for an infant defendant in any civil action may be appointed. The compensation of such guardian shall be determined by the court, and, together with his necessary expenses, shall be paid by the plaintiff if the court so orders.
Mass. Gen. Laws ch. 208, § 15