Cleaned up and used defusedxml for security