Try the following:
--Using a table variable.
DECLARE @data table(col1 XML);
INSERT @data
SELECT
'<data>
<test>
<ID>1</ID>
<Value>100</Value>
</test>
<test>
<ID>2</ID>
<Value>200</Value>
</test>
<test>
<ID>3</ID>
<Value>300</Value>
</test>
</data>';
WITH Result
AS
(SELECT a.col.value('ID[1]','int') AS ID,
a.col.value('Value[1]', 'int') AS Value
FROM @data
CROSS APPLY col1.nodes('//data/test') a(col)
)
SELECT MAX(ID) MAX_ID
FROM Result;