Removed in the “Starter” edition of Delphi XE2, code formatting is easily reinstituted with at least two 3rd party tools that I’m aware of. The first, my personal preference and the only one I plan to cover [others may get suggested in the comments section] is “GExperts Experimental by TWM”. One specific reason I much prefer this particular rendition of a code formatter is that to get it you need to install GExperts and, it is my opinion, you really should have GExperts installed and available in any Delphi IDE.
GExperts Experimental by TWM ... “These versions are always based on the current SubVersion/CVS repository code of the GExperts project. In addition to the normal functionality they include the code formatter formerly known as DelForEx. The code has kindly been donated by Egbert van Nes.”.
It is pretty easy to install and get running but you need to read and follow the instructions.