A BSA+ESP parser and writer code snippet to use as a reference for your own import/export code.
The parser is tailored specifically towards the TES4 Oblivion file format. Hopefully, with only minor modifications it can be used to read parent (Morrowind) and sibling (Fallout 3) formats as well.
The ESP list controller is able to create right ESP loading order exactly the same way as the game engine does.
This code is complete, but it's not a library. Please take this into consideration when you'll try to just compile this code into your project.