You might want to take a look at
this. It contains a stylesheet called ncx2end.xsl which can be used to transform a NCX to a nav TOC. It does support multiple levels of TOC.
I basically looked at the same thing yesterday to enable ePUB3 support in my add-in. However, I tried one document with MathML with fallback for ePUB2 and the results were dramatic. Even most ePUB3 readers made a mess of it. Only Chromium handled it correctly. I decided it was not worth the effort for me at the time.