C# and XML support the Edit.SurroundWith command that will insert the desired snippet around the selected code (whether it is just a selected word, selected line, or entire function)

Code Snippet Surround With

for loop surrounding a for loop

The keyboard shortcut is Ctrl+K, Ctrl+S.

Technorati tags: VS2005Tip, VS2008Tip