Xcode and Lion on a MacBook 2007?
It might be a bit slow. I am using an early 2009 MacBook with 4GB of RAM, and the performance of Lion wasn't as smooth as Snow Leopard. 

For the record, I am also running Xcode. It runs OK, not exactly smooth. So I think your experience on 2GB RAM might not be too pleasant.