Convert hierarchy into MT_LIBRARY