The basic chemical equation for this reaction is as follows:
The reaction occurs with anti addition, leaving the newly added X and OH groups trans to each other.
The reaction is a form of electrophilic addition.
In the first step, a halogen attacks the pi bond of the carbon-carbon double bond, forming a single bond to each of the two carbons. Then an H2O molecule bumps into the slightly positively charged carbon atom that results from step one, bonding before the negative halogen atom left over can bond. The oxygen at this point has three bonds and a positive formal charge. Another water molecule happens by quickly enough to escort off the extra H ion, leaving the final product.