/** * Convert this QuickBooks object to an XML node object representation * * @param string $root The node to use as the root node of the XML node structure * @param string $parent * @return QuickBooks_XML_Node */ public function asXML($root = null, $parent = null, $object = null) { if (is_null($root)) { $root = $this->object(); } if (is_null($object)) { $object = $this->_object; } $Node = new QuickBooks_XML_Node($root); foreach ($object as $key => $value) { if (is_array($value)) { $Node->setChildDataAt($root . ' ' . $key, '', true); foreach ($value as $sub) { //print('printing sub' . "\n"); //print_r($sub); //print($sub->asXML()); $Node->addChildAt($root, $sub->asXML(null, $root)); } } else { $Node->setChildDataAt($root . ' ' . $key, $value, true); } } //print_r($Node); return $Node; }