The .exist () method returns 1 if the XQuery expression evaluates to a nonzero list of nodes, otherwise it returns 0. Thus, it will return 1 every time in your example.
If I understand you correctly, do you want it to return 1 when the value is an integer, and 0 when it is XML?
:
declare @x xml
set @x='<root><a>12</a></root>'
select ISNUMERIC(CAST(@x.query('/') AS nvarchar))
0
declare @x xml
set @x='12'
select ISNUMERIC(CAST(@x.query('/') AS nvarchar))
1