def initialize(file, opts={})
@writer = REXML::Formatters::Default.new
if file.class == String
@fh = File.new(file,"w")
elsif file.respond_to?('write')
@fh = file
else
throw "must pass in file name or handle"
end
@fh.write("<?xml version='1.0'?>\n")
if opts[:stylesheet]
@fh.write(
%Q{<?xml-stylesheet type="text/xsl" href="#{opts[:stylesheet]}"?>\n})
end
@fh.write("<collection xmlns='" + MARC_NS + "' " +
"xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " +
"xsi:schemaLocation='" + MARC_NS + " " + MARC_XSD + "'>")
@fh.write("\n")
end