From four-to two-channel Kondo effect in junctions of XY spin chains