outsource all XPath generation stuff