I want one simple syntax without use "case when" to do the following work :
DECLARE @AllInfo xml
SET @AllInfo = '
<RooT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<HID xsi:nil="true" />
</RooT>'
select
(
case when node1.value('(HID/@xsi:nil)[1]','varchar(64)') = 'true'
then NULL
when (node1.value('(HID/@xsi:nil)[1]','varchar(64)') is null or node1.value('(HID/@xsi:nil)[1]','varchar(64)') = 'false') and node1.value('(HID/text())[1]','varchar(64)') is null
then ''
else
node1.value('(HID/text())[1]','varchar(64)')
end) HID
FROM @AllInfo.nodes('/RooT') T(node1)