XSD - unbound number of any (unkown) elements but last element sequence is defined
Is it possible using one or more XSDs to validate the following xml structure

    <container>
        <unkownA />
        <unkownB />
        <unkownC />
        ...
        <data />
    </container>

by those rules
<ol>
<li>there is an unlimited number of unkown elements
<li>there is at least one of those unkown elements
<li>the last element is data
<li>data occurs only once
<li>data is validated according to provided rules 
</ol>
All the elements in the xml have the **same namespace ("")**, which we can't change.
We are most likely not able to **change the order of the elements** as well, though I know this is probably the easiest solution.
Changing the xml in general is not an viable option, since it is generated by a external system we don't control.

I tried something like this

    <xs:sequence>
       <xs:any minOccurs="1" maxOccurs="unbounded" processContents="lax" />
       <xs:element ref="data" minOccurs="1" />
    </xs:sequence>

which of course, being ambiguous, violates the "Unique Particle Attribution".

I also read about the use of a second namespace here http://stackoverflow.com/questions/2592205
but since we can't change the xml this does not seem to be a solution or I plainly don't understand it properly.

By the we are using Java to process the xml/xsd, the xsd **resides in the classpath**, so xs:import from within an xsd might be a problem.

If the answer is "This can't be done with xsd within these constraints" I'm fine with it.

So any ideas?
XSD - unbound number of any (unkown) elements but last element sequence is defined
===

Is it possible using one or more XSDs to validate the following xml structure

    <container>
        <unkownA />
        <unkownB />
        <unkownC />
        ...
        <data />
    </container>

by those rules
<ol>
<li>there is an unlimited number of unkown elements
<li>there is at least one of those unkown elements
<li>the last element is data
<li>data occurs only once
<li>data is validated according to provided rules 
</ol>
All the elements in the xml have the **same namespace ("")**, which we can't change.
We are most likely not able to **change the order of the elements** as well, though I know this is probably the easiest solution.
Changing the xml in general is not an viable option, since it is generated by a external system we don't control.

I tried something like this

    <xs:sequence>
       <xs:any minOccurs="1" maxOccurs="unbounded" processContents="lax" />
       <xs:element ref="data" minOccurs="1" />
    </xs:sequence>

which of course, being ambiguous, violates the "Unique Particle Attribution".

I also read about the use of a second namespace here http://stackoverflow.com/questions/2592205
but since we can't change the xml this does not seem to be a solution or I plainly don't understand it properly.

By the we are using Java to process the xml/xsd, the xsd **resides in the classpath**, so xs:import from within an xsd might be a problem.

If the answer is "This can't be done with xsd within these constraints" I'm fine with it.

So any ideas?