Hide Parent if No Children

<?php     
    if ($post->post_parent) { //We are a child, print out sub menu
            wp_list_pages( array('title_li'=>'','include'=>$post->post_parent) );
            wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>$post->post_parent) );
    }

//We are not a child but do we have children
$children = wp_list_pages(array('child_of' => $post->ID, 'echo' => 0));

if ( !empty($children) ) {
    //If so print out the sub menu
    wp_list_pages( array('title_li'=>'','include'=>$post->ID) );
    wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>$post->ID) );
} 
//Not a child and not a parent so show nothing and continue 
?>

I tested this and it works as you mentioned, I couldn’t figure out that function however maybe someone can post a better solution using that function.