Photonic chip based all-optical XOR gate for phase-encoded signals