/**
* Persists an xml entity as part of the current unit of work.
*
* @param object $xmlEntity The xml entity to persist.
*/
public function persist($xmlEntity)
{
$class = $this->xem->getClassMetadata(get_class($xmlEntity));
if ($class->isMappedSuperclass) {
throw OXMException::cannotPersistMappedSuperclass($class->name);
}
if (!$class->isRoot) {
throw OXMException::canOnlyPersistRootClasses($class->name);
}
$visited = array();
$this->doPersist($xmlEntity, $visited);
}