Option 1 (simplest)
Delete extended partition using GParted or similar utility from a Linux/Windows LiveCD/USB (such as Hiren's), then install XP into unallocated space and it will create a primary partition and do the rest.
Option 2 (a bit harder)
XP onwards requires a primary active boot partition, but has no problems being installed to or running from a logical partition as long as the former condition is met. The simplest way to do this is to use something like GParted to create a small primary FAT32 partition, ideally at the beginning of the drive (mark it active as well while you're at it). Point XP Setup to install itself onto a logical partition and it should automatically install NTLDR and associated boot files on this primary partition.
In case XP fails to subsequently boot, the fix is simple. Use the XP Recovery Console from the installation media to copy NTLDR, BOOT.INI, NTDETECT.COM and NTBOOTDD.SYS (if it exists) to the small FAT32 partition, then run the fixboot and bootcfg /rebuild commands.
Windows 7 onwards has made this much simpler because it automatically creates a separate System Reserved partition for the bootmgr and BCD files as long as there's space on the drive, so it can be installed in a logical partition without any problems at all.