cant check if this works atm, but something like this should be what you are after, might need some modifications to filter out scripts and stuff.
$('body').children().each(function(index) {
yourarray[index] = $(this).text();
});
EDIT: Tried it out and realised it only takes the first children, not grandchildren and also includes alot of whitespace and stuff aswell, I don't have time to code the entire function for you, but here is a good start atleast. .find('*') fetches all elements inside the document.
$("body").find('*').each(function (index) {
//checks that the text isnt empty, no need to store that.
if ($(this).text() != '') {
//stores the elements text inside a temp variable,
//trims it from whitespaces and console.logs the results.
temp = $(this).text();
yourarray[index] = $.trim(temp);
console.log(index+': '+yourarray[index]);
}
});