Added idm:distance custom xpath function