Xml refactoring

Merging of the branches