Display all menu levels
I've managed to find an answer in a Stack Overflow answer https://stackoverflow.com/a/30570027/1094862

For completeness I've copied the relevant code below:

$main_menu_tree = menu_tree_all_data('menu-name', null, 3);
render_menu_tree($main_menu_tree);

function render_menu_tree($menu_tree) {
  print '&lt;ul&gt;';
  foreach ($menu_tree as $link) {
    print '&lt;li&gt;';
    $link_path = '#';
    $link_title = $link['link']['link_title'];
    if($link['link']['link_path']) {
        $link_path = drupal_get_path_alias($link['link']['link_path']);
    }
    print '&lt;a href="' . $link_path . '"&gt;' . $link_title . '&lt;/a&gt;';
    if(count($link['below']) &gt; 0) {
      render_menu_tree($link['below']);
    }
    print '&lt;/li&gt;';
  }
  print '&lt;/ul&gt;';
}