Fixes closing xml tags with leading whitespace
Updates xml handling