The only thing your post proves is that Berkeley DB XML is not a reliable foundation to build on. You can hide it under Windows or OSX, but I'm quite sure it will fail there someday too.
Writing clever code is not everything, you need to think about what you build it on too.