title: How to create a document from an Xml string
body: <p>I would like to transform a xml string (herself constructed from byte array with an external tool.</p>
  
  <p>My document and my input string was all of them created with the same xsd
  I read the string with <code>pub.string:stringToBytes</code> then I obtain an XmlNode from <code>pub.xml:xmlStringToXMLNode</code></p>
  
  <p>This part works well.</p>
  
  <p>I would after that create a document, call it Doc.
  I call <code>pub.xml:xmlNodeToDocument</code>. But the document returned is not in the correct type.
  I mean that all datas are correct with correct name, but when I tried to map some data to another document, it never works.</p>
  
  <p>I know it's not clear, sorry for that.
  So, in details, I have a simple xsd : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
      elementFormDefault="qualified"
      xmlns="http://tempuri.org/XMLSchema.xsd"
      xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
  &gt;
    &lt;xs:complexType name="EtdDaCisIUpdParty"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="wUpdatetsMax"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:maxLength value="15"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="wTpsnEtendu" type="WTpsnEtendu"/&gt;
        &lt;xs:element name="wTpsnExt" type="WTpsnExt" maxOccurs="unbounded" minOccurs="0"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  
    &lt;xs:complexType name="WTpsnEtendu"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="Id" type="xs:string"&gt;&lt;/xs:element&gt;
        &lt;xs:element name="Name" type="xs:string"&gt;&lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  
    &lt;xs:complexType name="WTpsnExt"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="key" type="xs:string"&gt;&lt;/xs:element&gt;
        &lt;xs:element name="value" type="xs:string"&gt;&lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  
    &lt;xs:element name="EtdDaCisIUpdParty" type="EtdDaCisIUpdParty" /&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>And a correspondant xml string conforming to this xsd :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;mstns:EtdDaCisIUpdParty  xmlns:mstns="http://tempuri.org/XMLSchema.xsd" &gt;
      &lt;mstns:wUpdatetsMax&gt;40&lt;/mstns:wUpdatetsMax&gt; 
      &lt;mstns:wTpsnEtendu&gt;
          &lt;mstns:Id&gt;13&lt;/mstns:Id&gt;
          &lt;mstns:Name&gt;Test&lt;/mstns:Name&gt;
      &lt;/mstns:wTpsnEtendu&gt;
      &lt;mstns:wTpsnExt&gt;
          &lt;mstns:key&gt;1&lt;/mstns:key&gt;
          &lt;mstns:value&gt;one&lt;/mstns:value&gt;
      &lt;/mstns:wTpsnExt&gt;
      &lt;mstns:wTpsnExt&gt;
          &lt;mstns:key&gt;2&lt;/mstns:key&gt;
          &lt;mstns:value&gt;something&lt;/mstns:value&gt;
      &lt;/mstns:wTpsnExt&gt;
      &lt;mstns:wTpsnExt&gt;
          &lt;mstns:key&gt;3&lt;/mstns:key&gt;
          &lt;mstns:value&gt;nothing&lt;/mstns:value&gt;
      &lt;/mstns:wTpsnExt&gt;
  &lt;/mstns:EtdDaCisIUpdParty&gt;
  </code></pre>
  
  <p>A document generated with the same xsd :
  <a href="https://i.stack.imgur.com/HXAWO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HXAWO.png" alt="enter image description here"></a></p>
  
  <p>Then I have a Flow service that transform an xml string to the document</p>
  
  <p><a href="https://i.stack.imgur.com/LBec0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LBec0.png" alt="enter image description here"></a></p>
  
  <p>It seems to works but it is not.
  If I add a simple map, it was never processed :</p>
  
  <p><a href="https://i.stack.imgur.com/uYc5G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uYc5G.png" alt="enter image description here"></a></p>
  
  <p>The pipeline in result never contains the value of the last map. After using debug mode, i understand that the resulting document of <code>pub.xml:xmlStringToXMLNode</code> is not the same type of my doc.</p>
  
  <p><a href="https://i.stack.imgur.com/YUqn8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YUqn8.png" alt="enter image description here"></a></p>
  
  <p>The <code>Id</code> string in the pipeline out is missing.</p>
  
  <p>What's wrong with my understanding and with my example ?</p>