Zend certified PHP/Magento developer

Export correct URL in product feed with XSL

I try to export product URL:s for my Magento 2.3 website using this line of code in an XSL template:
<xsl:element name=”link”><xsl:value-of select=”product_url“/></xsl:element>

The result creates this URL in the .XML file (which doesn’t work):

< link >https://www.domain.com/admin/catalog/product/view/id/2666/s/apple-ipad-2-16gb-wi-fi-vit-toppskick/key/a61acffaa09fed5b95dc91/< /link >

If I change “product_url” to “url_key”, I get this result:

< link >apple-ipad-2-16gb-wi-fi-vit-toppskick< /link >

That would be the correct URL if it wasnt missing https://www.domain.se/ in the beginning and .html at the end

Also, I have a similar problem with the “image” attribute, the result is:

< Bild-URL >https://www.domain.se/media/catalog/product/2/1/2180326_3_1_2_1_1_1_1_1.jpg< /Bild-URL >

That directs to 404 on the website, the link shouldn’t include /media/catalog etc.

Can someone assist how to accurately fetch a product URL and image URL for my product feed? Thank you in advance.