Section 56A. Any judge of a probate court may appoint a guardian ad litem to investigate the facts of any proceeding pending in said court relating to or involving questions as to the care, custody or maintenance of minor children and as to any matter involving domestic relations except those for the investigation of which provision is made by section sixteen of chapter two hundred and eight. Said guardian ad litem shall, before final judgment or decree in such proceeding, report in writing to the court the results of the investigation, and such report shall be open to inspection to all the parties in such proceeding or their attorneys. The compensation shall be fixed by the court and shall be paid by the commonwealth, together with any expense approved by the court, upon certificate by the judge to the state treasurer. The state police, local police and probation officers shall assist the guardian ad litem so appointed, upon his request.