Not able to get value of data if it has <b> or <i> in Word Template using VBA
<p>I was able to read XML file and convert in Array successfully. Now I want to add formatting in data. For this reason I have added  and  tag in XML but I am not able to get value of tag if it has  or  or any other formatting tag.</p>

<p>Here is code:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;TestClass&gt;
  &lt;TestObject&gt;
    &lt;Site&gt;&lt;b&gt;&lt;i&gt;Whatsapp&lt;/i&gt;&lt;/b&gt;&lt;/Site&gt;
    &lt;URL&gt;https://www.Whatsapp.com/ABC/&lt;/URL&gt;
  &lt;/TestObject&gt;
  &lt;TestObject&gt;
    &lt;Site&gt;Facebook&lt;/Site&gt;
    &lt;URL&gt;https://www.facebook.com/XYZ/&lt;/URL&gt;
  &lt;/TestObject&gt;
  &lt;TestObject&gt;
    &lt;Site&gt;Twitter&lt;/Site&gt;
    &lt;URL&gt;https://www.twitter.com/ABC/&lt;/URL&gt;
  &lt;/TestObject&gt;
&lt;/TestClass&gt;
</code></pre>

<p>Code:</p>

<pre><code>Dim oXMLFile As Object
Dim XMLFileName As String
Dim Sites As Object
Dim URLs As Object

Set oXMLFile = CreateObject("Microsoft.XMLDOM")
XMLFileName = "C:\Users\abc\Desktop\Files\Test.xml"
oXMLFile.Load (XMLFileName)

Set Sites = oXMLFile.SelectNodes("TestClass/TestObject/Site/text()")
Set URLs = oXMLFile.SelectNodes("TestClass/TestObject/URL/text()")

//Sites get only `Facebook` and `Twitter`
</code></pre>

<p>If I remove <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code>, it will work fine and I will get value of all 3 elements.</p>

<p>Please suggest how to manage formatting while getting value from XML.</p>