Тема: Видає помилку Access Violation
Викидає помилку  аксес відолейшин у місці де я її викликаю.
В даному випадку клік по кнопці.
function GetBalans(): String;
var stringstream: TStringStream;
var xml, balance, bal: String;
var root: IXMLNode;
begin
  stringstream:=Nil;
  IdHTTP1:=Nil;
  try
    stringstream:=TStringStream.Create('');
    IdHTTP1:=TIdHTTP.Create(nil);
    xml := '<?xml version="1.0" encoding="utf-8"?><request><operation>GETBALANCE</operation></request>';
    stringstream.WriteString(xml);
    stringstream.Position:=0;
    IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
    IdHTTP1.Request.ContentLength:=stringstream.Size;
    IdHTTP1.Request.BasicAuthentication:= true;
    IdHTTP1.Request.UserName := '********';
    IdHTTP1.Request.Password := '*********';
    balance:=IdHTTP1.Post(apiurl, stringstream);
    //SHowMessage(balance);
      finally
        stringstream.Free;
        IdHTTP1.Disconnect;
        IdHTTP1.Free;
      end;
      if (balance <> 'Access denied!') then
        begin
          XMLDocument1:= TXMLDocument.Create(form1);
          XMLDocument1.LoadFromXML(balance); // ???????????? ???? ? ????????.
          XMLDocument1.Active := true;
          root := XMLDocument1.DocumentElement;
          bal := trim(root.ChildNodes['balance'].Text);
        
          XMLDocument1.Free;
          XMLDocument1.Destroy;
        end;
Result := bal;
end;