move xpath functions to xpath.py