OK, upon further review (and straight from BOL, which you should check out):
<QUOTE>
FOR XML cannot be used in a selection that requires further processing in a stored procedure.
FOR XML cannot be used with cursors.
Generally, FOR XML cannot be used for any selections that do not produce direct output to the Microsoft® SQL Server™ 2000 client.
</QUOTE>
Meaning that you can't process the result in a stored procedure. You have to process it in a client (.NET, VB, whatever) that connects to the SQL instance.
Good luck,
Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'm not as think as you confused I am.
-----------
Flabbergasted (a.): Amazed at how much weight one has gained.
-----------
Oyster (n.): One who sprinkles their conversation with Yiddish expressions.