fallback to DOMDocument if Html5lib fails