Merge branches 'sgc' and 'simplexml-refactor'