Select FormatID, Name
, v.value('./@id', 'varchar(255)') Macro
, v.query('.') Commands
FROM Formats
CROSS APPLY GenMac.nodes('//g') TempXML(v)
where v.value('./@id', 'varchar(255)')='M23'
