# File lib/dm-serializer/xml_serializers/nokogiri.rb, line 9 def self.root_node(doc, name, attrs = {}) root = ::Nokogiri::XML::Node.new(name, doc) attrs.each do |attr_name, attr_val| root[attr_name] = attr_val end doc.root.nil? ? doc.root = root : doc.root << root root end