title: Adding a schema to .xml file
body: <p>I have made reference to some codes in the Internet to convert an Excel file into an .xml file.  As far as I understand, the codes first extract the information from the Excel file and convert it to a string, and then write the string into an .xml file.</p>
  
  <p>The codes used to write the string to the xml file are like this:</p>
  
  <pre><code>Sub sWriteFile(strXML As String, strFullFileName As String)
  
      Dim intFileNum As String
  
      intFileNum = FreeFile
      Open strFullFileName For Output As #intFileNum
      Print #intFileNum, strXML
      Close #intFileNum
  
  End Sub
  </code></pre>
  
  <p>After running the codes, I have an xml file like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;FATCA_OECD&gt;
      &lt;MessageSpec&gt;
          &lt;Tag2a&gt;XXX&lt;/Tag2a&gt;
          &lt;Tag2b&gt;XXX&lt;/Tag2b&gt;
      &lt;/MessageSpec&gt;
  &lt;/FATCA_OECD&gt;
  </code></pre>
  
  <p>I want the <code>FATCA_OECD</code> tag to become:</p>
  
  <pre><code>&lt;ftc:FATCA_OECD xsi:schemaLocation="urn:oecd:ties:fatca:v1 FatcaXML_v1.1.xsd" version="1.1" xmlns="urn:oecd:ties:stffatcatypes:v1" xmlns:ftc="urn:oecd:ties:fatca:v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  </code></pre>
  
  <p>and I also want the <code>MessageSpec</code> tag to become:</p>
  
  <pre><code>&lt;ftc:MessageSpec&gt;
  </code></pre>
  
  <p>I tried to type all the namespace information as strings in appropriate places of the codes.  However, whenever I add in special characters like colons, the .xml file generated from the codes appear to be a blank one.  </p>
  
  <p>How to fix this problem?</p>