hier_export function

Export a hierarchy into a file