It used to work until the XP PC was hacked!
AS you've experienced an XP machine on a network, especially an XP machine that has an internet connection as well as participating as a network node, is extremely susceptible to various malicious attacks and as it is no longer supported by Microsoft there is not much available in the way of options to make it more secure.
How did you recover from the "hack" are you certain that the XP machine is now, completely clean?
The first thing you probably need to do is create a user account ( as a member of the local administrator's group) with a strong password and resist using the built in Administrator account with a blank password.
After which, networking the two computers should work pretty much as it always has.
Make sure the machine names and IP addresses are unique and not duplicated on the network, make sure that both machines are members of the same "WorkGroup"
Share a folder and use the machine name followed by a backslash followed by the UserName and then
The password for that username when authenticating in the credentials prompt.
XPmachine\UserName
P@$$w0rd
Win10Machine\UserName
P@$$w0rd
Make sure that the username and password you are using exists on both machines, with the appropriate Share Permissions and NTFS (Security) Permissions to access the folder you are sharing and its' child objects (sub-folders and files).
After and only after you have sharing setup and configured as you want and any errors are resolved, then.....
Install some top tier third party anti virus / anti spyware on the XP machine.