You need the divide-doc.xsl style sheet.
Then, use a XSLT processor like saxon like this:
saxon -o test.html test-page.html divide-doc.xsl
To debug under Unix:
saxon -T -o test.html test-page.html divide-doc.xsl > & t.t
WARNING: This will not work for mixed contents (need to fix this sometimes) ! Source: http://www.w3.org/2003/09/divide-doc.xsl (but was totally outdated, had to fix it a bit)