I assume you are talking about Lightroom Classic. Are you?
If the .xmp files are put into the exact same folder as the original photo (you would use your operating system to move or copy the .xmp files), then you can reconnect via the Lightroom Classic command Metadata->Read Metadata from Files.
However, it seems as if the problem you have is that the xmps are in one folder and the photo files are somewhere in a lot of subfolders, and I'm not aware of an automated or bulk way to move the .xmp files into the proper folders, you'd have to do that one-by-one, or if you are fortunate you might be able to move several at once into the proper folder. You could probably use your operating system's search feature to find out what folder the original photo files are in.
All I can think of is to move all of your images into the same folder that has the XMPs. I am not sure if this would work but give each image in a given folder the name in keywords of that folder so you can move things around later (if you want/need to).
HOWEVER all file movement must be done within Lightroom, not in Finder/Explorer. Do NOT move the files outside of LR or you will have even more things to fix.