Web element propreties bug

when i use :
driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAToolbar[1]/UIASearchBar[1]")).getLocation();

the next clicks doesn’t work , anyone can help ?

int X = driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAToolbar[1]/UIASearchBar[1]")).getLocation().getX();
int Y = driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAToolbar[1]/UIASearchBar[1]")).getLocation().getY();

driver.tap(x,y,1000);

Try to improve the xpath as well. or use any other element location strategy