There are a number of ways to calculate distance between 2 sets of coordinates, but the lightest weight (and reasonably accurate) calculation for short distances is the Pythagorean theorem.
I don't think there's a way to write this in XPath. You would need to run a distance calculation between your location and every point in your database, which could be very slow depending on the number of rows you're searching.
Here's another thread I found on the matter. Based on this, here's how I would approach the issue: