Section 36. Any resident of this commonwealth who marries outside the commonwealth and thereafter resides within the United States or any of its territories or possessions, or the spouse or heirs-at-law of such a person, may personally present to the town clerk or registrar of the town where such person was domiciled at the time of said marriage an original certificate, declaration or other written evidence of the same, or a photostatic copy thereof. The clerk or registrar may file such certificate, declaration, written evidence or photostatic copy as evidence establishing such marriage, or may make a copy thereof, which he shall attest as a true copy, and which he may then file as such evidence.
If such certificate, declaration, written evidence, photostatic copy or attested copy is not, in the opinion of the clerk or registrar, sufficient to establish such marriage, and he refuses to file the same, a judge of probate in the county wherein such town lies may, on petition and after a hearing, at which the clerk shall have an opportunity to be heard, order him to receive such certificate, declaration, written evidence, photostatic copy or attested copy as sufficient evidence to establish such marriage, whereupon such clerk or registrar shall file the same.