private function marshalType($object, PiBX_AST_Type $ast) { $lastNode = $this->parentDomNode; $this->parentDomNode = $this->currentDomNode; if ($ast->isRoot()) { $targetNamespace = $ast->getTargetNamespace(); if ($targetNamespace != '') { $this->currentDomNode->setAttribute('xmlns', $targetNamespace); } } if ($ast->hasChildren()) { $childrenCount = $ast->countChildren(); for ($i = 0; $i < $childrenCount; $i++) { $child = $ast->get($i); $this->marshalObject($object, $child); } } $this->parentDomNode = $lastNode; }