Basic DOM parsing, mostly equivalent to the native DOMParser.