unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, StdCtrls, msxmldom, XMLDoc;type TForm1 = class(TForm) XMLDocument1: TXMLDocument; Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var RootNode, MsgListNode, MSG_STRUCT_node, AddrList_node, ADDR_STRUCT_node: IXMLNode; sFromAddr, sAddr: string;begin RootNode := XMLDocument1.DocumentElement; MsgListNode := RootNode.ChildNodes.FindNode('MsgList'); MSG_STRUCT_node := MsgListNode.ChildNodes.First; AddrList_node := MSG_STRUCT_node.ChildNodes.FindNode('AddrList'); sFromAddr := MSG_STRUCT_node.ChildNodes.FindNode('FromAddr').Text; ADDR_STRUCT_node := AddrList_node.ChildNodes.First; while ADDR_STRUCT_node <> nil do begin sAddr := sAddr + #10 + ADDR_STRUCT_node.ChildNodes.FindNode('Addr').Text; ADDR_STRUCT_node := ADDR_STRUCT_node.NextSibling; end; ShowMessage(sAddr + #10 +sfromaddr);end;procedure TForm1.FormCreate(Sender: TObject);begin XMLDocument1.XML.Text := '<?xml version="1.0" encoding="GB2312" ?>' + '<MSG_MSG_SEND_REQ>' + '<TranID>27</TranID>' + '<RetRec>0</RetRec>' + '<MsgList>' + '<MSG_STRUCT>' + '<SID>27301</SID>' + '<SN>1</SN>' + '<Channel>CHANNEL_EMAIL</Channel>' + '<AddrList>' + '<ADDR_STRUCT>' + '<AddrType>AT_EMAILTO</AddrType>' + '<ClientID></ClientID>' + '<Addr>test@test.com</Addr>' + '</ADDR_STRUCT>' + '<ADDR_STRUCT>' + '<AddrType>AT_EMAILTO</AddrType>' + '<ClientID></ClientID>' + '<Addr>test2@test2.com</Addr>' + '</ADDR_STRUCT>' + '</AddrList>' + '<BusinessType></BusinessType>' + '<Priority>PRIO_NORMAL</Priority>' + '<DeliverWay>DELIVERY_INSTANT</DeliverWay>' + '<POTList></POTList>' + '<LifeTime>0</LifeTime>' + '<BodyFormat>FORMAT_TEXT</BodyFormat>' + '<AtcIDList></AtcIDList>' + '<FromAddr>userid@message.cmbchina.com</FromAddr>' + '<EmailSubject>email test</EmailSubject>' + '<BBody>aGVsbG8gZW1haWwu</BBody>' + '<ReceiptAddr></ReceiptAddr>' + '<ReplyAddr></ReplyAddr>' + '<SubCode></SubCode>' + '</MSG_STRUCT>' + '</MsgList>' + '</MSG_MSG_SEND_REQ>'; XMLDocument1.Active := True;end;end.