XML structure reorganization