Ported union_pt() to XS