BUG: Add decl when xml_declaration=True and pretty_print=False for et…
…ree parser

- [X] references IO XML tracker #40131
- [X] tests added / passed
- [X] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry (not necessary,  module releases: v1.3.0)
