Text this: Design and Optimization of a Photonic Crystal-Based All-Optical XOR Gate Using Machine Learning