Drupal 6 – output your primary links as a Site Map

This took me a while to find: In Drupal 6, I wanted to output the main Primary Links menu item, expanded, as a site map:

Simply add the following to a node (with PHP parsing ON!)

<?php 
$tree = menu_tree_all_data($menu_name = ‘primary-links’, $item = NULL);
print menu_tree_output($tree);
?>