Fix get XPath code