U can use the inbuilt Stored Procedure...
DECLARE @idoc int, @doc varchar(1000);
SET @doc ='
<root>
<record>
<name> A </name>
<age> 21 </age>
</record>
<record>
<name> b </name>
<age> 22 </age>
</record>
</root>'
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc;
SELECT * FROM OPENXML (@idoc, '/Root/Record',2) WITH (Name varchar(10),Age Int);
Result:
Name Age
A 21
b 22