Split xml processing function into separate module.