Quickly render a xhtml page to text.
This function will render the entire page on a single line, which is somewhat unreadable. On the plus side, it's relatively fast.
Renders a pretty xhtml page with readable indentation.
What we do is turn the document from
Text into a
parse that string with
Text.XML.Light, then use
pretty printing function to render it, before finally packing it again.
It probably goes without saying, but this function is incredibly inefficient!
Text.XML.Light will render the document as proper XML, which is
fine only if you're not trying to pass of your page as text/html.