Cleaned up XML to JSON code.