My question is a follow up to How to parse restructuredtext in python?
I am trying to make a tool that processes .rst files and formats the code blocks in them, then writes them back to the original files. @mbdevpl provided some code samples about how to parse the file into a tree and do some processing on the tree. Now that I've discovered the code blocks and changed their contents, how do I write back the changes into the original file?