Display sub categories and their data of a taxonomy

You can use the parent argument in get_terms() to get direct children of a term.
You can use the child_of argument to get all descendents of a term.

Something like this.

$parent_id = 32;
$args = array(
    'parent' => $parent_id
);
$terms = get_terms( $taxonomy, $args );   
print_r( $terms );

If you want to programmatically get parent terms and within the loop get sub-categories, you could do something like this.

$taxonomy = 'your_tax';
$args = array(
    'parent' => 0 // to get only parent terms
);
$terms = get_terms( $taxonomy, $args );

foreach( $terms as $term ) {
    $children = get_terms( $taxonomy, array(
        'parent' => $term->term_id;
    ) );

    print_r( $children );
}

http://codex.wordpress.org/Function_Reference/get_terms

error code: 523