Do Not Display Parent Page if No Subpages

Personally, I think this is the neatest, least intensive (database querying) solution:

<?php
$parentid = $post->post_parent ? @ array_pop( get_post_ancestors( $post ) ) : $post->ID;
$children = wp_list_pages(
    array(
        "child_of' => $parentid,
        'title_li' => '',
        'echo'     => false,
    )
);

if ( $children ) : ?>

    <ul class="subpages">
        <li><a href="https://wordpress.stackexchange.com/questions/135921/<?php echo get_permalink( $parentid ) ?>"><?php echo get_the_title( $parentid ) ?></a></li>
        <?php echo $children ?>
    </ul>

<?php else : ?>

    Nothing!

<?php endif ?>