The query below is trying to select a child node of a given Node. How do I use a variable instead of hard coding the child node such that I can pass them as parameters in a
declare @Node varchar(50)
set @Node = 'TimeZone'
declare @ChildName varchar(50)
set @ChildName='HiddenName'
;WITH XMLNAMESPACES(DEFAULT 'http://tempuri.org')
select N.value('.', 'varchar(100)') as Value
from @T as T
cross apply T.XMLCol.nodes('//*[local-name()=sql:variable("@Node")]/children/*[local-name(.)=sql:variable("@ChildName")]') as X(N)