We're using Rails to feed XML to a small embedded-Linux device. This
device has very strict memory requirements, so we've have to compact
the XML output. The default Rails format uses elements for
attributes:
This approach may work for objects that have only primitive data types as their attributes, but it fails when serializing objects that have attributes that themselves are objects with their own attributes. For that reason, I don't think this is useful as a general way to compact the XML output. There's also the issue of how to parse the incoming XML, and how to distinguish between the two XML formats. Removing unnecessary white space is probably the simplest thing you can do to reduce the size of the generated XML. Anything else is an adventure in plugin-land.