PS: You can also supply HTML parsing options via fetch:xml:
fetch:xml( 'http://basex.org/', map { 'parser': 'html', 'htmlparser': map { 'nons': false() } } )
In future, if you want to use the HTTP Module, your request could look as simple as this:
html:parse( http:get($url)?body, map { 'nons': false() } )
We are still working out if response parsing will be integrated in the http:get call:
let $serializer := map { 'parser': 'html', 'htmlparser': map { 'nons': false() } } return http:get( $url, map { 'serializer': $serializer } )('body')