I want to rename all files in a folder and add a .xml extension. I am using Unix.  How can I do that?
In Python:
Use os.listdir to find names of all files in a directory. If you need to recursively find all files in sub-directories as well, use os.walk instead. Its API is more complex than os.listdir but it provides powerful ways to recursively walk directories.
Then use os.rename to rename the files.
How to add .xml extension to all files in a folder in Unix/Linux