WITH XMLNAMESPACES (
DEFAULT 'http://www.w3.org/2000/svg',
'http://www.w3.org/1999/xlink' AS xlink
)
SELECT
'example.jpg' AS 'image/@xlink:href',
'50px' AS 'image/@width',
'50px' AS 'image/@height'
FOR XML PATH('svg')
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<image xlink:href="/?originalUrl=https%3A%2F%2Friptutorial.com%2F%26quot%3Bfirefox.jpg%26quot%3B%2520width%3D%26quot%3B50px%26quot%3B%2520height%3D%26quot%3B50px%26quot%3B%2F%26gt%3B%26lt%3B%2Fsvg%26gt%3B%253C%2Fcode">