Hi, I suppose you use Vb script.
Here some code that can help you:
Dim oItem, oParent, oPrevious, temp
Set oItem = XDocument.DOM.selectSingleNode("/my:XMLTOPUTHTML")
Set oParent = oItem.parentNode
Set oXML = CreateObject("MSXML2.DomDocument.5.0")
oXML.async = false
MyHtml= "Your htmlCode"
oXML.loadXML("<?xml version=""1.0"" encoding=""UTF-8""?><my:XMLTOPUTHTML><div>"&MyHtml&"</div></my:XMLTOPUTHTML>")
oXML.setProperty "SelectionNamespaces", "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xhtml=""http://www.w3.org/1999/xhtml"" xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" xmlns:my=""YOUR My:Schema"" xmlns:xd=""http://schemas.microsoft.com/office/infopath/2003"""
Set row = oXML.selectSingleNode("my:XMLTOPUTHTML")
oParent.replaceChild row, oItem
Hope it's help.