Finding the XPath with element's name (iOS)

Hey there, I am trying to extract the full XPath of a UIAStatic Text element using its name/value or label.
I am using extraction the other way around but I wonder if there’s a way to find the XPath using the name instead.

Can you try this and see?

element = driver.findelement(by name);
xpath = element.GetAttribute(“xpath”);