title: Adding a single repeating node to target schema using BizTalk mapper
body: <p>I'm currently working on a BizTalk project and I encountered a problem which I'm sure should be solvable within a mapping. However, I don't seem to be able to figure out how. Hopefully someone can help me out.</p>
  
  <p>The situation is as follows: in both the source and the target schema, there's a repeating node with roughly the same child elements underneath it (no records or attributes involved). The repeating node within the source has a structure like this:</p>
  
  <pre><code>&lt;fruit&gt;
      &lt;item&gt;
          &lt;sort&gt;Apple&lt;/sort&gt;
          &lt;size&gt;5cm&lt;/size&gt;
          &lt;colour&gt;red&lt;/colour&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;sort&gt;Pear&lt;/sort&gt;
          &lt;size&gt;8cm&lt;/size&gt;
          &lt;colour&gt;green&lt;/colour&gt;
      &lt;/item&gt;
  &lt;/fruit&gt;
  </code></pre>
  
  <p>While the repeating node in the target looks more like this:</p>
  
  <pre><code>&lt;FRUIT&gt;
      &lt;SORT&gt;Apple&lt;/SORT&gt;
      &lt;SIZE&gt;5cm&lt;/SIZE&gt;
      &lt;COLOUR&gt;red&lt;/COLOUR&gt;
  &lt;/FRUIT&gt;
  &lt;FRUIT&gt;
      &lt;SORT&gt;Pear&lt;/SORT&gt;
      &lt;SIZE&gt;8cm&lt;/SIZE&gt;
      &lt;COLOUR&gt;green&lt;/COLOUR&gt;
  &lt;/FRUIT&gt;
  </code></pre>
  
  <p>What I need the mapping to do, is ensure that if there's any fruit available, there are at least two records 'fruit' available in the target. This should be achieved by adding a generic fruit (just think of some arbitrary pineapple, if you like) to the target, if there's only one fruit available at the source.</p>
  
  <p>As a first step, I tried just adding one more fruit node to the target and failed to do so. I'm pretty confident that if I know how to do this, I can solve the actual problem by combining it with the 'count records' and 'logical equality'(=1) functoids.</p>
  
  <p>So the question boils down to: how do I add a single record to the target inside a mapping?</p>
  
  <p>I've tried several options (and combinations of these), namely:</p>
  
  <ul>
  <li>using a looping functoid over the elements "fruit" or "item", together with some extra value mapping.</li>
  <li>directly adding an extra value mapping</li>
  <li>adding direct links between "item" or "fruit" and "FRUIT", either with or without looping functoid inbetween.</li>
  </ul>
  
  <p>In most of these cases, either I got a result containing children like</p>
  
  <pre><code>&lt;FRUIT&gt;
      &lt;SORT&gt;Pear&lt;/SORT&gt;
      &lt;SORT&gt;Pineapple&lt;/SORT&gt;
      &lt;SIZE&gt;8cm&lt;/SIZE&gt;
      &lt;COLOUR&gt;green&lt;/COLOUR&gt;
  &lt;/FRUIT&gt;
  </code></pre>
  
  <p>(and a corresponding error since this doesn't satisfy the schema - which doesn't allow for multiple elements SORT), or a whole bunch of pineapples. Neither of which is wished for.</p>
  
  <p>Can anyone help me out?</p>