order of XML attributes

He,

does anyone know why XML attributes get lexicographically ordered by default?

scala>
res0: scala.xml.Elem =

scala>
res1: scala.xml.Elem =

The problem I have concerns XPaths with only position information. For example, considering

the XPath "./@1" gives me "a='A'", however for

I again retrieve "a='A'" which is wrong. I know that in XML in general the order of attributes does not matter, but in this case it does.

Any suggestions?

Cheers,

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland