I'm not sure what you mean by order, but if you are working with a
list of items you can order the array and the to_xml will reflect
that. Otherwise if by order you mean having different xml blocks in a
post request then use a hash. The order in which the items are
contained within the xml won't matter as long as they are all there
and in the proper structure. For example, say we are using a person a
payment and a product, and the payment is in the person block.
h = Hash.new
h['person'] = Person.first.attributes
h['person']['payment'] = "$100.00"
h['product'] = Product.first
h.to_xml(:root => 'notification')