function saveCollection($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $collection = new Collection(); $collection->parseDomDocument($domDoc); $ret = $collection->insertRecord(); return $ret; }