title: JAXB UnMarshall Collection element order - continued
body: <p>I am aware that almost the same question has been asked before (<a href="https://stackoverflow.com/questions/5299943/jaxb-unmarshall-collection-element-order">here</a>). Despite that there is one interesting answer, there is still a loose end (in the case of unmarshalling) that also seems to apply in our case. </p>
  
  <p>Here's our situation: we're parsing SOAP messages, the body of which is structured like this:</p>
  
  <pre><code>&lt;complexType name="Body"&gt;
    &lt;complexContent&gt;
      &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
        &lt;sequence&gt;
          &lt;element ref="{http://[message=spec url]"/&gt;
        &lt;/sequence&gt;
      &lt;/restriction&gt;
    &lt;/complexContent&gt;
  &lt;/complexType&gt;
  </code></pre>
  
  <p>Until now, we have assumed that the order of the <strong></strong> would be preserved in the (Array)Lists that result from the unmarshalling process. The <strong>elements</strong> are then written to a table and processed further in PL/SQL procedures. This is usually not sensitive to the order of the elements within a sequence.
  It can happen thought that there are two <strong>elements</strong> in the SOAP message that refer to the same object. This is an error. It's caught in the PL/SQL code, which deals with it by logging the situation and rejecting the second element. </p>
  
  <p>Our problem now is that, very rarely and (until now) completely non-reproducible, not the second <strong>element</strong> (as seen in the SOAP message) is rejected, but the first. Seen from the PL/SQL code, this can only happen if the data, that represent the <strong>elements</strong> in case, are being read in the wrong order (compared again to how they appear in the message). </p>
  
  <p>Therefore, I was wondering if this situation might arise because the order of the marshalled <strong>elements</strong> is not explicitly defined.
  In the answer to the above-mentioned question it looks like the order is defined in the case of marshalling with JAXB. The - as yet unanswered - question (by <a href="https://stackoverflow.com/users/589517/chahuistle">chahuistle</a>) whether this is also the case for unmarshalling, is not yet answered. </p>
  
  <p>I'd appreciate any help!</p>