def parse(xml)
      @hash     = Hash.from_xml(xml)
      @server   = Server.new(@hash["monit"]["server"])
      @platform = Platform.new(@hash["monit"]["platform"])

      options = {
        :host     => @host,
        :port     => @port,
        :ssl      => @ssl,
        :auth     => @auth,
        :username => @username,
        :password => @password
      }

      if @hash["monit"]["service"].is_a? Array
        @services = @hash["monit"]["service"].map do |service|
          Service.new(service, options)
        end
      else
        @services = [Service.new(@hash["monit"]["service"], options)]
      end
      true
    rescue
      false
    end
def parse(xml)
      @hash     = Hash.from_xml(xml)
      @server   = Server.new(@hash["monit"]["server"])
      @platform = Platform.new(@hash["monit"]["platform"])

      options = {
        :host     => @host,
        :port     => @port,
        :ssl      => @ssl,
        :auth     => @auth,
        :username => @username,
        :password => @password
      }

      if @hash["monit"]["service"].is_a? Array
        @services = @hash["monit"]["service"].map do |service|
          Service.new(service, options)
        end
      else
        @services = [Service.new(@hash["monit"]["service"], options)]
      end
      true
    rescue
      false
    end
Parse the XML from Monit into a hash and into a Ruby representation.