anchor.diff:      let salt = node.Attributes.["salt"].Value
   
       username, Decrypt salt password
  -           
  -let private saveCredentials (source : string) (username : string) (password : string) (credentialsNode : XmlNode) =
  -    let salt, encrypedPassword = Encrypt password
  +
  +let private createSourceNode (credentialsNode : XmlNode) source =
       let node = credentialsNode.OwnerDocument.CreateElement("credential")
       node.SetAttribute("source", source)
  +    credentialsNode.AppendChild node |> ignore
  +    node
  +
  +let private setCredentials (username : string) (password : string) (node : XmlElement) =
  +    let salt, encrypedPassword = Encrypt password
       node.SetAttribute("username", username)
       node.SetAttribute("password", encrypedPassword)
       node.SetAttribute("salt", salt)
  -    credentialsNode.AppendChild node |> ignore
  -    saveConfigNode credentialsNode
       node
   
   
  
positive.code: 
  let AddCredentials (source, username, password) =
      let credentialsNode = getConfigNode "credentials"
      
      match getSourceNodes credentialsNode source with
      | existingNode::_ ->
          let existingPassword = 
              Decrypt 
                  existingNode.Attributes.["salt"].Value
                  existingNode.Attributes.["password"].Value
  
          if existingPassword <> password then
              let salt, encrypted = Encrypt password
              existingNode.Attributes.["username"].Value <- username
              existingNode.Attributes.["password"].Value <- encrypted
              existingNode.Attributes.["salt"].Value <- salt
              saveConfigNode credentialsNode
              
          existingNode
      | [] -> 
          saveCredentials source username password credentialsNode :> XmlNode
  
  
  let askAndAddAuth (source : string) (username : string) : unit = 
      if not Environment.UserInteractive then
  
negative.code: 
  let getSourceNodes (credentialsNode : XmlNode) (source) = 
      credentialsNode.SelectNodes "//credential"
      |> Seq.cast<XmlElement>
      |> Seq.filter (fun n -> n.Attributes.["source"].Value = source)
      |> Seq.toList
  
  