Is Windows XP immune to ransomware?
VMS is the answer!
The bigger question is how Windows XP is used. If it is not linked to the internet what is the risk of intrusion?
If hacked using a personal media devices then all systems have that vulnerability.
Even the latest Operating Systems are not immune - Sys Admins and Security folks running servers and firewalls are the line of defense - not the user interface OS. Protect the network and the OS will do its job.