Ciao luca200,

puoi usare
codice:
document.getElementsByTagName('html')(0).outerHTML;