SQL stored procedure to produce custom XML text
This seems to at least approach a solution for you.  You might need to add in some data type detection and conversions to make it work for you though.  It also makes an assumption that the first column for the table is the ID column...

DECLARE @TableName NVARCHAR(100) = 'dbo.MyTableName'
DECLARE @SQLCommand NVARCHAR(4000)

;WITH CTE_Initial AS
    (
    SELECT CONCAT('&lt;', CASE WHEN C.column_id = 1 THEN 'TOP (' + C.name + ')' ELSE 'FIELD fieldname="(' + C.name + ')"' END, ' value="', '''', ' + ', '[T].', QUOTENAME(C.name), ' + ', '''', '"/&gt;') AS XMLColumnName
            , * 
    FROM sys.columns AS C 
    WHERE C.object_id = OBJECT_ID(@TableName) 
    )
SELECT @SQLCommand = 'SELECT ' + STRING_AGG(CONCAT('''', XMLColumnName, ''''), '+') + ' FROM ' + @TableName + ' AS T' FROM CTE_Initial

PRINT @SQLCommand 

--EXEC sp_executesql @SQLCommand