retrieve xmp filename for duplicate in lua

For custom processing, in the lua file I do the usual

for i_, i in ipairs(dt.gui.action_images) do

exporting the image is easy, but to get the full set of metadata, I want to use exiftool not only on the raw file, but on the xmp file, too. This is not a problem as long as the selected image is not a duplicate, because I can simply concatenate the raw filename and ‘.xmp’

But in the case of a duplicate, how can I retrieve the relevant xmp filename?


found it - i.sidecar was all I needed