Will XORing the FIO0PIN register on an LPC175x6x give unexpected results?
That's exactly why there are FIOxSET and FIOxCLR registers:

FIO0CLR = (1&lt;&lt;4);
FIO0SET = (1&lt;&lt;22);


Those do not need a read-modify-write cycle to clear or set pins.