# File lib/dm-serializer/to_xml.rb, line 57
    def to_xml_document(opts = {})
      xml = DataMapper::Serialize::XMLSerializers::SERIALIZER
      doc = xml.new_document
      default_collection_element_name = lambda {Extlib::Inflection.pluralize(Extlib::Inflection.underscore(self.model.to_s)).tr("/", "-")}
      root = xml.root_node(doc, opts[:collection_element_name] || default_collection_element_name[], {'type' => 'array'})
      self.each do |item|
        item.send(:to_xml_document, opts, doc)
      end
      doc
    end