Refactor XML updating, add extension point