You can copy Xcode from one Mac to another by following steps:

1. Copy /Developer
2. Copy /System/Library/PrivateFrameworks/MobileDevice.framework
This will enable Xcode install compiled application on iPhone
3. Copy /usr/lib/gmalloc.*
This will enable Guard Malloc