DECLARE @xml as xml
SET @xml =
'
1
'
SELECT DISTINCT
CAST(Attribute.Name.query('local-name(.)') AS VARCHAR(100)) Attribute,
Attribute.Name.value('.','VARCHAR(100)') Value
FROM @xml.nodes('//@*') Attribute(Name)
Returns:
Attribute Value
ba 1
bb 2
bc 3
bd 3