Python script converts XML to JSON or the other way around