This is a very old impact printer. Discontinued long before Windows XP was introduced. No specific Window XP driver was ever written for it. You can try using the generic drivers included with Windows XP os but clicking on Start, Printers & Faxes. When you get to "manufacturer", select Epson 24 Pin Compatible. Then send a printer job and note results. If that doesn't work then try some generic drivers like Generic Text Only or Generic Graphics.
Note: the KX-P1540 is not listed under Panasonic, but there are some KX-P16xx models that you might wish to try.