HTML is not generally XML. I suspect that this code will not work for 99% of all web pages in existence (doesn't mean it won't work for any particular page you're interested in, of course, especially if that page happens to be XHTML).
Evacuate the building! Here, take this tiny ad with you:
how do I do my own kindle-like thing - without amazon