anchor.diff:  hash_xml_attribute({"to", _} = Attr) -> Attr;
   hash_xml_attribute({"from", _} = Attr) -> Attr;
   hash_xml_attribute({"noack", _} = Attr) -> Attr;
  -hash_xml_attribute({Attr, Value}) -> {Attr, "_BASE64:" ++  base64:encode_to_string(Value)}.
  +hash_xml_attribute({Attr, Value}) -> {Attr, "_BASE64:" ++ base64:encode_to_string(Value)}.
   
   %@doc Prepares the reportEvent command
  -prepare_event_command(Event) -> prepare_event_command(Event, "").
  -prepare_event_command(Event, Type) -> lists:keydelete(Type, 1, prepare_event_command(Event, Type, "")).
  -prepare_event_command(Event, Type, Value) ->
  +prepare_event_command(Event, Host) -> prepare_event_command(Event, "", Host).
  +prepare_event_command(Event, Type, Host) -> proplists:delete(Type, prepare_event_command(Event, Type, "", Host)).
  +prepare_event_command(Event, Type, Value, Host) ->
     [{"command", "reportEvent" ++ ucfirst(Type)},
  -   {"component", "copilot.ejabberd"},
  +   {"component", "copilot.ejabberd." ++ Host},
      {"event", Event},
      {Type, Value}].
   
   %@doc Sends a reportEvent command to the Monitor
  -report_event(Server, Event) ->
  -  To = gen_mod:get_module_opt(Server, ?MODULE, monitor_jid, "mon@localhost"),
  +report_event(Host, Event) ->
  +  To = gen_mod:get_module_opt(Host, ?MODULE, monitor_jid, "mon@localhost"),
     XmlBody = {xmlelement, "message", [{"from", ?JID},
                                        {"to", To},
                                        {"noack", "1"}],
  -                                     [{xmlelement, "info", prepare_event_command(Event), []}]},
  +                                     [{xmlelement, "info", prepare_event_command(Event, Host), []}]},
     route_to_copilot_component(To, XmlBody),
     ok.
  -report_event(Server, Event, Value, Type) ->
  -  To = gen_mod:get_module_opt(Server, ?MODULE, monitor_jid, "mon@localhost"),
  +
  +%@doc Sends a reportEvent{Type} command to the Monitor
  +report_event(Host, Event, Value, Type) ->
  +  To = gen_mod:get_module_opt(Host, ?MODULE, monitor_jid, "mon@localhost"),
     XmlBody = {xmlelement, "message", [{"from", ?JID},
                                        {"to", To},
                                        {"noack", "1"},
  -                                    [{xmlelement, "info", prepare_event_command(Event, Value, Type), []}]]},
  +                                    [{xmlelement, "info", prepare_event_command(Event, Value, Type, Host), []}]]},
     route_to_copilot_component(To, XmlBody),
     ok.
  
positive.code: 
    ok.
  
  on_set_presence(User, Server, Resource, _Packet) ->
    {IPAddress, _} = ejabberd_sm:get_user_ip(User, Server, Resource),
    handle_presence(connect, {User, Server, Resource}, IPAddress).
  on_unset_presence(User, Server, Resource, _Status) ->
    handle_presence(disconnect, {User, Server, Resource}, null).
  
  %@doc Handles presence stanzas sent by users
  handle_presence(UserState, {_User, Server, _Resource} = JID, IPAddress) ->
    % Processes the stanza in the gen_server
    gen_server:cast(?MODULE, {UserState, JID, IPAddress}),
    report_event(Server, atom_to_list(UserState)),
    ok.
  
  %%% gen_server %%%
  
negative.code: parse_component_jid(User) ->
    case string:tokens(User, "_") of
      ["agent"|_] = Props -> lists:zip([component, version, cores, jobs, uuid, ukn], lists:map(fun bson:utf8/1, Props));
      [Component|_] -> [{component, bson:utf8(Component)}]
    end.
  
  %@doc Creates a MonoDB document describing the connection
  