STYLE: fixing linting issues (redefined-outer-name)
Fixing pylint issues in xml.py, style.py, and _json.py

- [ ] Adds Fixes to #49656
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

I am a new contributor to Pandas, and still learning the ropes, I apologize ahead of time for making any rookie mistakes. Any advice would be highly appreciated! 
This code causes the tests to fail, will need to troubleshoot why. 