It's kinda ugly, but if you put "FOR XML PATH" at the end of the query, it shoves everything into one value with XML formatting in it.
You could do something like this:
declare @List NVARCHAR(4000)
select @List = COALESCE(@List + ', ' + convert(nvarchar(10), nodeid) + ' ' + caption, convert(nvarchar(10), nodeid) + ' ' + caption) from nodes
where NodeID = 1 OR NodeID = 2
This returns one value as a string of concatenated text. Obviously, change the format, where clause, and columns to your needs, but the concept is the same.
APM does something similar with their built-in SQL Functions:
You may consider creating your own function or stored procedure to pass in params on the fly.