Echo Permalink in Attachment outside of loop?

Jez, unpatient Jez 🙂

<?php
        $args = array(
           'post_type' =>  'attachment',
           'numberposts' =>  -1,
           'post_status' =>  null,
           'post_parent' =>  $post->ID
          );

          $attachments = get_posts( $args );
             if ( $attachments ) {
                foreach ( $attachments as $attachment ) {
                   echo '<li>  <a href="'. get_permalink($attachment->ID) .'" title="Permanent Link to<?php the_title_attribute(); ?>">';
                   echo wp_get_attachment_image( $attachment->ID, 'full' );
                   echo '</a></li>';
                  }
             }
?>

tried it, worked for me.