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);
    }