Split out xml parser

Also, fixed a number of issues with the ContractCreator.stg