Added comments, if/else, and different params to XML gen.