Generating a State Machine from VS2010 UML Diagrams
Manuel shows a great way how to generate a state machine from the build-in class diagram in VS 2010 RTM using T4 Templates.
I highly recommend reading his article here and get the UML Profile for State Diagrams for VS2010 and the T4 template from his blog.
Manuel’s Article: https://halllo-welt.spaces.live.com/blog/cns!E6C5570276BDBE2B!562.entry