$domtree = new DOMDocument('1.0', 'UTF-8');
/* create the root element of the xml tree */
$xmlRoot = $domtree->createElement("xml");
/* append it to the document created */
$xmlRoot = $domtree->appendChild($xmlRoot);
//create the root Envelope
$currentTrack = $domtree->createElement("Envelope");
$currentTrack = $xmlRoot->appendChild($currentTrack);
/* you should enclose the following two lines in a cicle */
//create the first child node
$c= $currentTrack->appendChild($domtree->createElement('Header'));
$c->appendChild($domtree->createElement('AccountId','04af6cbcfb9f3038281b06389803d577'));
在这里,我将“version=2.1”添加到标题中。我该如何添加?