Some of us like to do things ourselves, without shopping around for a pre-built library with pages of syntax and options.
A simple and braindead way of reformatting things like xml or Oracle tnsnames.ora entries is to count opening and closing delimiters to determine where to use tabs, CR's, etc. Reading one charcter at a time makes this somewhat easy. In this case it doesn't matter if the file is being buffered or not because decisions about the output, not input, are being made per character.