fix in XML_Formatter + change: PBXScheme supports adding PBXLegacyTarget

while the formatter had a bug, I am not sure if the change of PBXScheme should make it into the project: I need it in https://github.com/HBehrens/pebblex to declare a shell script as executable after building with an external tool. This works great in AppCode but causes an error in Xcode.

As this seems to be a rare case, I can live with [my monkey patch](https://github.com/HBehrens/pebblex/blob/master/lib/pebble_x/monkey_patches.rb) for the PBXScheme change.