Your function can be written as:
cartesianProduct[{x_List, y_List}] := ReplaceList[{x, y}, {{___, a_, ___}, {___, b_, ___}} -> {a, b}]
It should give the desired output:
In[]:= cartesianProduct[{{x1, x2, x3}, {y1, y2}}]
Out[]= {{x1, y1}, {x1, y2}, {x2, y1}, {x2, y2}, {x3, y1}, {x3, y2}}