implementation
uses
Laz2_DOM, Laz2_XMLWrite;
procedure TForm1.ShowInfo;
var
XmlDoc: TXMLDocument;
Root, Child: TDOMElement;
StrStr: TStringStream;
begin
XmlDoc := TXMLDocument.Create;
Root := XmlDoc.CreateElement('catalogocuentas:Catalogo');
Root.AttribStrings['xmlns:catalogocuentas'] := 'http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/CatalogoCuentas';
Root.AttribStrings['xmlns:xsi'] := 'http://www.w3.org/2001/XMLSchema-instance';
Root.AttribStrings['xsi:schemaLocation'] := 'http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/CatalogoCuentas http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/CatalogoCuentas/CatalogoCuentas_1_3.xsd';
Root.AttribStrings['Version'] := '1.3';
Root.AttribStrings['RFC'] := 'ROAP640729JZ5';
Root.AttribStrings['Mes'] := '02';
Root.AttribStrings['Anio'] := '2025';
XmlDoc.AppendChild(Root);
Child := XmlDoc.CreateElement('catalogocuentas:Ctas');
Child.AttribStrings['CodAgrup'] := '101.01';
Child.AttribStrings['NumCta'] := '100-000-000';
Child.AttribStrings['Desc'] := 'FONDO FIJO DE CAJA';
Child.AttribStrings['Nivel'] := '1';
Child.AttribStrings['Natur'] := 'D';
Root.AppendChild(Child);
Child := XmlDoc.CreateElement('catalogocuentas:Ctas');
Child.AttribStrings['CodAgrup'] := '102.01';
Child.AttribStrings['NumCta'] := '100-000-000';
Child.AttribStrings['Desc'] := 'BANCOMER SA DE CV';
Child.AttribStrings['Nivel'] := '1';
Child.AttribStrings['Natur'] := 'D';
Root.AppendChild(Child);
StrStr := TStringStream.Create;
WriteXmlFile(XmlDoc, StrStr);
MemoXML.Text := StrStr.DataString;
StrStr.Free;
XmlDoc.Free;
end;