cleanup xml & templates