<element>
<data>foo</data>
</element>
<element>
<data>bar</data>
</element>
<element>
<data>monkey</data>
</element>
<element>
<data>fish</data>
</element>
<data>foo</data>
</element>
<element>
<data>bar</data>
</element>
<element>
<data>monkey</data>
</element>
<element>
<data>fish</data>
</element>
You can get around this XML limitation by explicitly adding an order/index attribute to your ordered elements. For example:
<element
n="1">
<data>foo</data>
</element>
<element n="2">
<data>bar</data>
</element>
<element n="3">
<data>monkey</data>
</element>
<element n="4">
<data>fish</data>
</element>
<data>foo</data>
</element>
<element n="2">
<data>bar</data>
</element>
<element n="3">
<data>monkey</data>
</element>
<element n="4">
<data>fish</data>
</element>
In order to work with data like this, you'll need to pre-populate the "n" attribute before you generate the XML (iterating over the elements and setting the "n" attribute) and you'll need to post-process the "n" attribute after you parse the XML (iterating over the elements to get the "n" attribute and reordering the elements appropriately).
Here's a LabVIEW example that demonstrates this technique (note that this example uses JKI's EasyXML library):
For more tips and tricks for using XML in LabVIEW, and EasyXML in particular, visit the EasyXML Tips and Tricks page on the JKI Software website.