You can use <?php the_meta(); ?>
to do this (id you want to print them inside the Loop).
From Codex:
This is a simple built-in function for displaying custom fields for the current post, known as the "post-meta" (stored in the wp_postmeta table). It formats the data into an unordered list (see output below).
It must be used from within The Loop or in a theme file that handles data from a single post (e.g. single.php). the_meta() will ignore meta_keys (i.e. field names) that begin with an underscore.
So this:
<p>Meta information for this post:</p>
<?php the_meta(); ?>
Will output this:
<ul class='post-meta'>
<li><span class='post-meta-key'>your_key:</span> your_value</li>
... other fields
</ul>
Of course you can also do something like this (it's much easier to customize this code):
if ( $keys = get_post_custom_keys($post_id) ) { // $post_id is ID of your post
echo "<ul class='post-meta'>\n";
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
if ( is_protected_meta( $keyt, 'post' ) )
continue;
$values = array_map('trim', get_post_custom_values($key));
foreach ( $values as $k=>$value ) {
if ( $value == '' ) { // or whatever is your way to find if value is irrelevant
unset($values[$k]);
}
}
$value = implode($values,', ');
echo apply_filters('the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value);
}
echo "</ul>\n";
}