It is possible to marry in Costa Rica!  The required documents are: a valid passport or valid travel documents and a sworn statement (affidavit) signed in the presence of a Costa Rican lawyer.  If divorced, you will need the official documents of such divorce from your country or wherever the divorce was granted.