# File lib/storage/xmlstore.rb, line 28
  def initialize(dbfile)
    super()
    @dbfile = "#{dbfile}.xml"

    # check if database exists and build it if not
    build_database
    log.info "Loading world..."
    @db = {}

    # load the yaml database and sets @dbtop to highest object id
    File.open(@dbfile) do |f|
      XMLRPC::Marshal.load(f.read).each do |o|
        @dbtop = o.id if o.id > @dbtop
        @db[o.id]=o
      end
    end

    log.info "Database '#{@dbfile}' loaded...highest id = #{@dbtop}."
#    log.debug @db.inspect
  rescue
    log.fatal "Error loading database"
    log.fatal $!
    raise
  end