Random 'for loop'

is there a way to make a random ‘for loop’ like:

for (m = 0; m < max_entries; m++) {

i’m pulling stuff from an xml file and would like the loop to display all the entries, but in a random order rather than 0, 1, 2, 3.

if i used the random math function i’m not sure how to tell the loop which entries have been displayed and which have not.

any ideas/help would be greatly appreciated!