public function mapEntity($entity, $entityName = null)
    {
        // It's module entity
        if (is_null($entityName)) {
            if (empty($this->module)) {
                throw new \Exception('Invalid module, it must be set before mapping entity', 1);
            }
            $entityName = $this->module;
            $entity = [$entity];
        }

        $xml = '<' . $entityName . '>';
        $xml .= is_array($entity) ? $this->mapEntityList($entity) : $this->mapSingleEntity($entity);
        $xml .= '</' . $entityName . '>';
        return $xml;
    }