In short, all I need is to make my WordPress do this

$var = get_template_part( 'loop', 'index' ); 

but, get_template_part() does not return HTML, it prints it.
I need this HTML stored in $var - do you have any ideas how to do it?

Edit
Report