I have an array of user objects which I want to return as xml. How can I use to_xml to include attributes on the root element? For example
<users total="10">
<user>
..
</user>
</users>
I know you can add custom elements and attributes to the xml using a block with the to_xml method, but I'm not sure how to add to the root element. Maybe there's another way other than using to_xml