How to using insert XML to XML file

Este sección contiene programas, extras, plugins, tutoriales y demas sobre Setup Factory.
How to using XML.InsertXML my default XML file is:

Código: Seleccionar todo

<products> 
  <product> 
    <course id="SK-ENG-L1-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="1" titleKey="PE_ENG_1_course_title" language="en-US" resource="68cebc9173417426b9c277770e7aca3cc4847a03" encrypted="true"> 
<installed>false</installed> 
</course> 
Insert here below XML file:

Código: Seleccionar todo

<course id="SK-ENG-L2-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="2" titleKey="PE_ENG_2_course_title" language="en-US" resource="f626f5187b2ba7417f822324f964238fb6c16719" encrypted="true">  
 <installed>false</installed> 
</course> 

Código: Seleccionar todo

<activations> 
      <activation> 
        <productID>SK-ENG-L1-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_1_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L1-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
 

Insert here below XML file:

Código: Seleccionar todo

<activation> 
        <productID>SK-ENG-L2-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_2_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L2-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
</activations> 
</product> 
  </products> 
 
Result below XML file:

Código: Seleccionar todo

<products> 
  <product> 
    <course id="SK-ENG-L1-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="1" titleKey="PE_ENG_1_course_title" language="en-US" resource="68cebc9173417426b9c277770e7aca3cc4847a03" encrypted="true"> 
<installed>false</installed> 
</course> 
<course id="SK-ENG-L2-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="2" titleKey="PE_ENG_2_course_title" language="en-US" resource="f626f5187b2ba7417f822324f964238fb6c16719" encrypted="true">  
 <installed>false</installed> 
</course> 
<activations> 
      <activation> 
        <productID>SK-ENG-L1-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_1_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L1-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
<activation> 
        <productID>SK-ENG-L2-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_2_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L2-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
</activations> 
</product> 
</products>

use logic and texfile.writefromstring or use the xml component using node interface.

please be more specific.

Imagen

Sorry Pabloko.
How to solve this problem?
My Default XML file is

Código: Seleccionar todo

<?xml version="1.0" encoding="UTF-8"?>
<products> 
  <product> 
    <course id="SK-ENG-L1-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="1" titleKey="PE_ENG_1_course_title" language="en-US" resource="68cebc9173417426b9c277770e7aca3cc4847a03" encrypted="true"> 
    <installed>false</installed> 
</course> 
<activations> 
      <activation> 
        <productID>SK-ENG-L1-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_1_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L1-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation>
<activations>
   </product>
</products>
will insert XML file is:

Código: Seleccionar todo

<?xml version="1.0" encoding="UTF-8"?>
<course id="SK-ENG-L2-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="2" titleKey="PE_ENG_2_course_title" language="en-US" resource="f626f5187b2ba7417f822324f964238fb6c16719" encrypted="true">  
 <installed>false</installed> 
</course> 
<activations>
      <activation> 
        <productID>SK-ENG-L2-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_2_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L2-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
</activations> 

Result XML file is:

Código: Seleccionar todo

<?xml version="1.0" encoding="UTF-8"?>
<products> 
  <product> 
    <course id="SK-ENG-L1-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="1" titleKey="PE_ENG_1_course_title" language="en-US" resource="68cebc9173417426b9c277770e7aca3cc4847a03" encrypted="true"> 
<installed>false</installed> 
</course> 
<course id="SK-ENG-L2-NA-PE-NA-NA-Y-3.7.1.0.r29" levelIndex="2" titleKey="PE_ENG_2_course_title" language="en-US" resource="f626f5187b2ba7417f822324f964238fb6c16719" encrypted="true">  
 <installed>false</installed> 
</course> 
<activations> 
      <activation> 
        <productID>SK-ENG-L1-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_1_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L1-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
<activation> 
        <productID>SK-ENG-L2-NA-PE-NA-NA-Y-3</productID> 
        <activationID/> 
        <deactivationID/> 
        <titleKey>PE_ENG_2_course_title</titleKey> 
        <courses> 
          <course>SK-ENG-L2-NA-PE-NA-NA-Y-3</course> 
        </courses> 
      </activation> 
</activations> 
  </product> 
</products>
Imagen
I tried
XML.Load(SessionVar.Expand("%WindowsFolder%\\products.xml"));
XML.InsertXML("products/product/course", "<course id=\"SK-ENG-L2-NA-PE-NA-NA-Y-3.7.1.0.r29\" levelIndex=\"2\" titleKey=\"PE_ENG_2_course_title\" language=\"en-US\" resource=\"f626f5187b2ba7417f822324f964238fb6c16719\" encrypted=\"true\">\r\n<installed>false</installed>\r\n</course>", XML.INSERT_AFTER);
XML.InsertXML("products/product/activations/activation", "<activation>\r\n<productID>SK-ENG-L2-NA-PE-NA-NA-Y-3</productID>\r\n<activationID/>\r\n<deactivationID/>\r\n<titleKey>PE_ENG_2_course_title</titleKey>\r\n<courses>\r\n<course>SK-ENG-L2-NA-PE-NA-NA-Y-3</course>\r\n</courses>\r\n</activation>", XML.INSERT_AFTER);
XML.Save(SessionVar.Expand("%WindowsFolder%\\rsapp3\\products.xml"));
But Result is not changed