Adam's dom.d will get you pretty far. I believe it can also handle documents that aren't completely well-formed.https://github.com/adamdruppe/arsd/blob/master/dom.d
HTML-docs here: http://dpldocs.info/experimental-docs/arsd.dom.html throught Adam's own web-service.