The solution is quite simple: as suggested by Pepto, bcp can execute a stored procedure instead of a SELECT.
So :
DECLARE @cmd varchar(200)
SET @cmd='bcp "execute MyDb.dbo.MySP" queryout D:\myFile.xml -c -T'
EXEC xp_cmdshell @cmd
Where MySP
is a stored procedure containing my huge SELECT statement.