This is a tricky problem to generally solve. I think this does it approximately well enough. It is lightly tested and works by exactly matching headlines at subsequent levels. It will be problematic if you have headlines with : in them, and it assumes there is a level 1 headline to start in.
#+BEGIN_SRC emacs-lisp
(defun xpath-follow (path)
(let* ((fields (split-string path "::"))
(fname (car fields))
(paths (split-string (cadr fields) ":"))
(level 0)
(current-point (point))
cp hls n found)
(org-mark-ring-push)
(find-file fname)
(save-restriction
(while paths
(setq cp (pop paths))
(incf level)
(setq hls (org-element-map (org-element-parse-buffer) 'headline
(lambda (hl)
(when (eq level (org-element-property :level hl))
hl))))
(setq n (-find-index (lambda (hl)
(string= cp (org-no-properties
(org-element-property :raw-value hl))))
hls))
(if (not n)
(progn
(goto-char current-point)
(user-error "%s not found" cp))
(goto-char (org-element-property :begin (nth n hls)))
(org-narrow-to-subtree))))))
(org-link-set-parameters
"xpath"
:follow 'xpath-follow)
#+END_SRC