Gets a consistent xpath for a single DOM element.