in reply to XML::Simple--dealing with a variable element

You may find the data structure easier to deal with if you turn off array folding by specifying KeyAttr => {} in your call to XMLin(). Then, at the top level, the dataschema key will point to an array of elements in the order they occurred in the source document rather than a hash keyed on the value of the name attribute.

I'm not sure why you've included the ->[0] in your code. There are no arrays in your dumped output.