指定名称空间
Version >= SQL Server 2008
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="firefox.jpg" width="50px" height="50px"/>
</svg>