anchor.diff:  normalise_response(X) -> X.
   
   
  -% Parse teams from XML into list of strings
  +%% parse_teams/1
  +%% ====================================================================
  +%% @doc
  +%% Parses user's teams from XML to a list of strings.
  +%% @end
  +-spec parse_teams(string()) -> [string()].
  +%% ====================================================================
   parse_teams(XMLContent) ->
       {XML, _} = xmerl_scan:string(XMLContent),
       #xmlElement{content = TeamList} = find_XML_node(teams, XML),
  
positive.code:         end, TeamList).
  
  
  % Find certain XML node in one parent -> one children hierarchy
  find_XML_node(NodeName, #xmlElement{name = NodeName} = XMLElement) ->
      XMLElement;
  
  
negative.code: %% Internal functions
  %% ====================================================================
  
  %% discover_op_endpoint/1
  %% ====================================================================
  %% @doc
  %% Retrieves an XRDS document from given endpoint URL and parses out the URI which will
  %% be used for OpenID login redirect.
  %% @end
  -spec discover_op_endpoint(string()) -> string().
  %% ====================================================================
  discover_op_endpoint(EndpointURL) ->
      XRDS = get_xrds(EndpointURL),
      {Xml, _} = xmerl_scan:string(XRDS),
      xml_extract_value("URI", Xml).
  
  
  %% xml_extract_value/2
  %% ====================================================================
  %% @doc
  %% Extracts value from under a certain key
  %% @end
  -spec xml_extract_value(string(), #xmlElement{}) -> string().
  %% ====================================================================
  xml_extract_value(KeyName, Xml) ->
      [#xmlElement{content = [#xmlText{value = Value} | _]}] = xmerl_xpath:string("//" ++ KeyName, Xml),
      Value.
  
  
  %% get_xrds/1
  %% ====================================================================
  %% @doc
  %% Downloads an XRDS document from given URL.
  %% @end
  -spec get_xrds(string()) -> string().
  %% ====================================================================
  get_xrds(URL) ->
      % Maximum redirection count = 5
      {ok, 200, _, Body} = get_xrds(URL, 5),
      Body.
  
  % Gets xrds file performing GET on provided URL. Supports redirects.
  get_xrds(URL, Redirects) ->
      ReqHeaders =
          [
              {"Accept", "application/xrds+xml;level=1, */*"},
              {"Connection", "close"}
          ],
      ResponseRaw = ibrowse:send_req(URL, ReqHeaders, get),
      Response = normalise_response(ResponseRaw),
  