refactor pretty xml