You don't need to use SPs for this purpose. SQL Server provides default support in querying XML Documents.
Below is the query that you can use in your case
DECLARE @XML XML
Set @XML ='<ROOT><a1>456</a1><b1>457</b1><g1>458</g1></ROOT>'
Select
Code = lvl1.n.value('local-name(.)','nvarchar(max)')
,Name = lvl1.n.value('text()[1]','nvarchar(max)')
From @XML.nodes('ROOT/*') lvl1(n)
You can also find a similar problem along with its solution
sql server - Select all XML nodes from XML column - Stack Overflow[
^]