I think you can also use a formula to get what you need:
substring-before(substring-after(/processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'href="'), '"')
gets me the location of my published form, regardless of where it is published.