Couple things could be happening here
1) Your camera focuses by 'seeing' lines of contrast then focusing until the line is as sharp as possible. So, If you point it at a plain white sheet of paper, the camera will keep hunting for focus since there's not lines to focus on. If you add a straight black line to the paper and try the excersice again, your camera will use the thick black line and be able to lock focus.
2) Your XS allows your to choose a focus point. I think you have 9 AF points and if your camera is in auto, it will just bounce between those 9 and look for something to focus on. This can be frustrating as sometimes it focuses on your desired target, other times on a tall tree in the background...grrrrr! You can go into the AF selection menu and select which part of the AF sensor should use to focus (the middle, the left, right, upper...etc.). This way it will only focus on what's in that targeted area.
AF is a function of the camera, not the lens. It is possible that the lens' focus is off and will always backfocus or front focus, but I doubt the hunting is a result of a bad lens.
Good luck and post examples!