Gets an xpath to an element.