This is an excerpt from Manning's book SQL Server MVP Deep Dives Vol. 2. Login to get full access to this book.
Figure 7. Output from the stored procedure using the multiple WITH RESULT SETS and AS FOR XML options