function parseHTML(text) { var createHTMLDocument = function() { var xsl = (new DOMParser()).parseFromString( ['<?xml version="1.0"?>', '<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">', '<output method="html"/>', '</stylesheet>'].join("\n"), "text/xml"); var xsltp = new XSLTProcessor(); xsltp.importStylesheet(xsl); var doc = xsltp.transformToDocument( document.implementati