This behavior can be controlled with :only, :except,
:skip_instruct, :skip_types, :dasherize and
:camelize . The :only and :except options are
the same as for the attributes method. The default is to dasherize
all column names, but you can disable this setting :dasherize to
false. Setting :camelize to true will camelize
all column names - this also overrides :dasherize. To not have the
column type included in the XML output set :skip_types to
true.

Additionally, the record being serialized will be passed to a Proc's
second parameter. This allows for ad hoc additions to the resultant
document that incorporate the context of the record being serialized. And
by leveraging the closure created by a Proc, to_xml can be used to add
elements that normally fall outside of the scope of the model – for
example, generating and appending URLs associated with models.