Reformat XML tree for reqularity.