declare @xmlVal xml
set @xmlVal =
'<user>
<token><id>ABC123</id><endDate>2013-06-16 18:48:50.111</endDate></token>
<token><id>XYX456</id><endDate>2014-01-01 18:48:50.111</endDate></token>
</user>'
我需要整个令牌节点作为 id=ABC123 的 xml,所以输出将是:
<token>
<id>ABC123</id>
<endDate>2013-06-16 18:48:50.111</endDate>
</token>