"Ya canna change the laws of physics, Jim!"
Unfortunately a lot of folks try to use nanotech as an explanation for the size changing of the Transformers (what hard core Transformers fans refer to as "mass shifting"). The common cartoon/comic book theory is that each Transformer contains a tiny "warp tube" that allows for additional mass to be syphoned in from another location (presumably Cybertron). The problem with this theory is the sheer amount of energy required to open a rift and send and receive that kind of mass would be mind boggling, considering the low amount of Energon they seem to have on hand, this would be a gross waste of resources, but that is another thread.
The nanotech issue arises from the fact that it would also take a huge amount of energy for a ninite to break the atomic bonds of whatever material it was rearranging. Even worse is the amount of energy that would be given off (we're talking nuclear fission here.) Each Transformer would change into something alright, a huge cloud of high energy particles i.e. a radioactive cloud after an incredible explosion.
Mass shifting requires a lot of suspension of disbelief, and i don't think it would work well in a live action movie (the real world).
The reformat of the shapes of the Transformers could be explained by a memory metal sort of outer shell, it could, in effect, be programed to take the shape of whatever they wanted, when when proper energy was applied to the metal it would change. There would still be large moving parts that make up the permanent shape (Remember that on cybertron the bots looked the same as they do on earth in robot mode, in the cartoon at least)