I would have this be a more "official" thing. Perhaps call this `dot_interpolate(xpath, context)` and put it in a file called xpath.py or something. This isn't the only place this is done, so also replace the other to use this helper too.