Fixed XML bugs implemented in previous commits