Looking at the source code, obviously, you pass the second argument "attributes"to attachToXml:
public function attachToXml($data, $prefix, &$parentNode = false) {
if(!$parentNode) {
$parentNode = &$this->mainNode;
}
if(strtolower($prefix) == 'attributes') {
foreach($data as $key=>$val)
$parentNode->setAttribute($key, $val);
$node = &$parentNode;
}
}
source
share