Avast maintained a legacy client for Windows XP for a long time. You may need to find the specific version 18.8 or older to ensure compatibility with XP, though it may still receive virus definition updates.
You cannot safely browse the modern web on Windows XP SP2. antivirus free windows xp sp2