Repository: atviriduomenys/spinta

Issue:
Enum on nested property does not work
```
cat > /tmp/manifest.txt <<EOF
d | r | b | m | property    | type    | ref        | source | prepare
example                     |         |            |        |
  |   |   | Option          |         | id         |        |
  |   |   |   | id          | integer |            |        |
  |   |   | Answer          |         | id         |        |
  |   |   |   | id          | integer |            |        |
  |   |   |   | opinion     | ref     | Option     |        |
  |   |   |   | opinion.o1  | integer |            |        |
  |   |   |   |             | enum    |            |        | 1
  |   |   |   |             |         |            |        | 0
  |   |   |   | opinion.o2  | integer |            |        |
  |   |   |   |             | enum    |            |        | 1
  |   |   |   |             |         |            |        | 0
EOF
spinta check /tmp/manifest.txt
```

This gives following error:

```python
Traceback (most recent call last):
  File "spinta/cli/config.py", line 35, in check
    prepare_manifest(context, ensure_config_dir=True)
  File "spinta/cli/helpers/store.py", line 136, in prepare_manifest
    store = load_manifest(
  File "spinta/cli/helpers/store.py", line 120, in load_manifest
    commands.load(
  File "spinta/manifests/yaml/commands/load.py", line 108, in load
    commands.load(
  File "spinta/manifests/tabular/commands/load.py", line 58, in load
    load_manifest_nodes(context, into, schemas, source=manifest)
  File "spinta/manifests/helpers.py", line 134, in load_manifest_nodes
    for eid, schema in schemas:
  File "spinta/manifests/tabular/helpers.py", line 1444, in read_tabular_manifest
    yield from _read_tabular_manifest_rows(
  File "spinta/manifests/tabular/helpers.py", line 1399, in _read_tabular_manifest_rows
    reader.read(row)
  File "spinta/manifests/tabular/helpers.py", line 1174, in read
    self.error(
  File "spinta/manifests/tabular/helpers.py", line 217, in error
    raise TabularManifestError(f"{self.path}:{self.line}: {message}")
spinta.manifests.tabular.helpers.TabularManifestError:
    /tmp/manifest.txt:9:
        Enum '' item '1' with the same value is already defined.
```

It looks, that enum is attached to `opinion` property instead of `opinion.o2`.


### Might be related

- https://github.com/atviriduomenys/spinta/issues/397

Discussion:

Patch:
diff --git a/.gitignore b/.gitignore
index 0b50d60b..0d3bd167 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
 /tags
 /var/
 /.idea/
+ruff.toml
 
 # pyenv
 .python-version
diff --git a/CHANGES.rst b/CHANGES.rst
index b806eae5..e23c006c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -6,20 +6,6 @@ Changes
 0.1.72 (unreleased)
 ===================
 
-Improvements:
-
-- Added support for negative float values in `starlette` float routing (use `spinta_float` instead of `float` type) (`#781`_).
-
-  .. _#781: https://github.com/atviriduomenys/spinta/issues/781
-
-Bug fixes:
-
-- Fixed `_srid` routing error, when using negative float values as coordinates (`#781`_).
-
-- Fixed `Geometry` boundary check not respecting `SRID` latitude and longitude order (used to always assume, that x = longitude,
-  y = latitude, now it will try to switch based on `SRID`) (`#737`_).
-
-  .. _#737: https://github.com/atviriduomenys/spinta/issues/737
 
 0.1.71 (2024-09-12)
 ===================
diff --git a/Makefile b/Makefile
index 6cebcb30..da9e282e 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ test: env
 
 .PHONY: run
 run: env
-	poetry run uvicorn spinta.asgi:app --debug
+	poetry run uvicorn spinta.asgi:app --reload --log-level debug
 
 .PHONY: psql
 psql:
diff --git a/notes/types/geometry.sh b/notes/types/geometry.sh
index 8d33b4f8..88a454b0 100644
--- a/notes/types/geometry.sh
+++ b/notes/types/geometry.sh
@@ -49,88 +49,88 @@ psql -h localhost -p 54321 -U admin spinta -c '\d "'$DATASET'/Lake3D"'
 
 # notes/spinta/client.sh    Configure client
 
-http POST "$SERVER/$DATASET/Lake" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake" $AUTH \
     name="Victoria" \
-    place="POINT (6237902 432224)" \
+    place="POINT (432224 6237902)" \
     shape="POLYGON ((
-        6237680.75000000 432588.50000000,
-        6237684.50000000 432585.62500000,
-        6237682.50000000 432587.00000000,
-        6237680.75000000 432588.50000000
+        432588.50000000 6237680.75000000,
+        432585.62500000 6237684.50000000,
+        432587.00000000 6237682.50000000,
+        432588.50000000 6237680.75000000
     ))"
 #| Geometry SRID (0) does not match column SRID (3346)
 
 
-http POST "$SERVER/$DATASET/Lake" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake" $AUTH \
     name="Victoria" \
-    place="SRID=3346; POINT (6237902 432224)" \
+    place="SRID=3346; POINT (432224 6237902)" \
     shape="SRID=3346; POLYGON ((
-        6237680.75000000 432588.50000000,
-        6237684.50000000 432585.62500000,
-        6237682.50000000 432587.00000000,
-        6237680.75000000 432588.50000000
+        432588.50000000 6237680.75000000,
+        432585.62500000 6237684.50000000,
+        432587.00000000 6237682.50000000,
+        432588.50000000 6237680.75000000
     ))"
 #| HTTP/1.1 201 Created
 
 
-http POST "$SERVER/$DATASET/Lake" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake" $AUTH \
     name="Victoria" \
-    place="SRID=3346; POINT (6237902 432224)" \
+    place="SRID=3346; POINT (432224 6237902)" \
     shape="SRID=3346; ((
-        6237680.75000000 432588.50000000,
-        6237684.50000000 432585.62500000,
-        6237682.50000000 432587.00000000,
-        6237680.75000000 432588.50000000
+        432588.50000000 6237680.75000000,
+        432585.62500000 6237684.50000000,
+        432587.00000000 6237682.50000000,
+        432588.50000000 6237680.75000000
     ))"
 #| parse error - invalid geometry
 
 
-http POST "$SERVER/$DATASET/Lake" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake" $AUTH \
     name="Victoria" \
-    place="SRID=3346; POINT (6237902 432224 42)"
+    place="SRID=3346; POINT (432224 6237902 42)"
 #| Geometry has Z dimension but column does not
 
 
-http POST "$SERVER/$DATASET/Lake" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake" $AUTH \
     name="Victoria" \
     shape="SRID=3346; POLYGON ((
-        6237680.75000000 432588.50000000 42,
-        6237684.50000000 432585.62500000 42,
-        6237682.50000000 432587.00000000 42,
-        6237680.75000000 432588.50000000 42
+        432588.50000000 6237680.75000000 42,
+        432585.62500000 6237684.50000000 42,
+        432587.00000000 6237682.50000000 42,
+        432588.50000000 6237680.75000000 42
     ))"
 #| Geometry has Z dimension but column does not
 
-http POST "$SERVER/$DATASET/Lake3D" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake3D" $AUTH \
     name="Victoria" \
-    place="SRID=3346; POINT (6237902 432224 42)"
+    place="SRID=3346; POINT (432224 6237902 42)"
 #| HTTP/1.1 201 Created
 
 
-http POST "$SERVER/$DATASET/Lake3D" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake3D" $AUTH \
     name="Victoria" \
-    place="SRID=3346; POINT (6237902 432224)"
+    place="SRID=3346; POINT (432224 6237902)"
 #| Column has Z dimension but geometry does not
 
 
-http POST "$SERVER/$DATASET/Lake3D" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake3D" $AUTH \
     name="Victoria" \
     shape="SRID=3346; POLYGON ((
-        6237680.75000000 432588.50000000 42,
-        6237684.50000000 432585.62500000 42,
-        6237682.50000000 432587.00000000 42,
-        6237680.75000000 432588.50000000 42
+        432588.50000000 6237680.75000000 42,
+        432585.62500000 6237684.50000000 42,
+        432587.00000000 6237682.50000000 42,
+        432588.50000000 6237680.75000000 42
     ))"
 #| HTTP/1.1 201 Created
 
 
-http POST "$SERVER/$DATASET/Lake3D" "$AUTH" \
+http POST "$SERVER/$DATASET/Lake3D" $AUTH \
     name="Victoria" \
     shape="SRID=3346; POLYGON ((
-        6237680.75000000 432588.50000000,
-        6237684.50000000 432585.62500000,
-        6237682.50000000 432587.00000000,
-        6237680.75000000 432588.50000000
+        432588.50000000 6237680.75000000,
+        432585.62500000 6237684.50000000,
+        432587.00000000 6237682.50000000,
+        432588.50000000 6237680.75000000
     ))"
 #| Column has Z dimension but geometry does not
 
@@ -139,26 +139,26 @@ http POST "$SERVER/$DATASET/Lake3D" "$AUTH" \
 http GET "$SERVER/$DATASET/Lake?select(name,place)&format(ascii)"
 #| --------  ----------------------
 #| name      place
-#| Victoria  POINT (6237902 432224)
+#| Victoria  POINT (432224 6237902)
 #| --------  ----------------------
 
 
 http GET "$SERVER/$DATASET/Lake?select(name,shape)&format(ascii)"
 #| --------  --------------------------------------------------------------------------------------------
 #| name      shape
-#| Victoria  POLYGON ((6237680.75 432588.5, 6237684.5 432585.625, 6237682.5 432587, 6237680.75 432588.5))
+#| Victoria  POLYGON ((432588.5 6237680.75, 432585.625 6237684.5, 432587 6237682.5, 432588.5 6237680.75))
 #| --------  --------------------------------------------------------------------------------------------
 
 
 http GET "$SERVER/$DATASET/Lake3D?select(name,place)&format(ascii)"
 #| --------  ---------------------------
 #| name      place
-#| Victoria  POINT Z (6237902 432224 42)
+#| Victoria  POINT Z (432224 6237902 42)
 #| --------  ---------------------------
 
 
 http GET "$SERVER/$DATASET/Lake3D?select(name,shape)&shape!=null&format(ascii)"
 #| --------  ----------------------------------------------------------------------------------------------------------
 #| name      shape
-#| Victoria  POLYGON Z ((6237680.75 432588.5 42, 6237684.5 432585.625 42, 6237682.5 432587 42, 6237680.75 432588.5 42))
+#| Victoria  POLYGON Z ((432588.5 6237680.75 42, 432585.625 6237684.5 42, 432587 6237682.5 42, 432588.5 6237680.75 42))
 #| --------  ----------------------------------------------------------------------------------------------------------
diff --git a/spinta/backends/__init__.py b/spinta/backends/__init__.py
index 7768c126..1f866d56 100644
--- a/spinta/backends/__init__.py
+++ b/spinta/backends/__init__.py
@@ -57,7 +57,6 @@ from spinta.types.datatype import Ref
 from spinta.types.datatype import String
 from spinta.types.datatype import Time
 from spinta.types.geometry.components import Geometry
-from spinta.types.geometry.helpers import get_crs_bounding_area
 from spinta.types.text.components import Text
 from spinta.utils.config import asbool
 from spinta.utils.encoding import encode_page_values
@@ -417,10 +416,17 @@ def simple_data_check(
         if srid is None:
             raise SRIDNotSetForGeometry(dtype)
 
-        bounding_area = get_crs_bounding_area(srid)
-
+        crs = CRS.from_user_input(srid)
+        transformer = Transformer.from_crs(crs.geodetic_crs, crs, always_xy=True)
+        west, south, east, north = transformer.transform_bounds(*crs.area_of_use.bounds)
+        bounding_area = shapely.geometry.box(
+            minx=west,
+            maxx=east,
+            miny=south,
+            maxy=north
+        )
         if not bounding_area.contains(shape):
-            raise CoordinatesOutOfRange(dtype, given=value, srid=srid, bounds=bounding_area.bounds)
+            raise CoordinatesOutOfRange(dtype, given=value, srid=crs, bounds=(west, south, east, north))
 
 
 @commands.complex_data_check.register(Context, DataItem, Model, Backend)
diff --git a/spinta/backends/postgresql/types/geometry/helpers.py b/spinta/backends/postgresql/types/geometry/helpers.py
index 0f251a5b..2c90fdb4 100644
--- a/spinta/backends/postgresql/types/geometry/helpers.py
+++ b/spinta/backends/postgresql/types/geometry/helpers.py
@@ -30,12 +30,6 @@ def get_osm_link(value: WKBElement, srid: Optional[Union[int, Geometry]]) -> Opt
         )
         shape = transform(transformer.transform, shape)
     centroid = shape.centroid
-
-    # According to WGS84 (4326) `axis_info`
-    # Axis order is:
-    # x: Axis(name=Geodetic latitude, abbrev=Lat, direction=north, unit_auth_code=EPSG, unit_code=9122, unit_name=degree)
-    # y: Axis(name=Geodetic longitude, abbrev=Lon, direction=east, unit_auth_code=EPSG, unit_code=9122, unit_name=degree)
-    # Meaning x - lat, y - lon
     lat, lon = centroid.x, centroid.y
     params = urlencode({'mlat': lat, 'mlon': lon})
 
diff --git a/spinta/exceptions.py b/spinta/exceptions.py
index 5b226cdf..d93efe63 100644
--- a/spinta/exceptions.py
+++ b/spinta/exceptions.py
@@ -319,7 +319,7 @@ class InvalidManifestFile(BaseError):
 
 
 class CoordinatesOutOfRange(UserError):
-    template = 'Given coordinates: {given!r} ar not within the `EPSG: {srid!r}` available bounds: {bounds} (west, south, east, north).'
+    template = 'Given coordinates: {given!r} ar not within the {srid!r} available bounds: {bounds} (west, south, east, north).'
 
 
 class ManifestFileDoesNotExist(BaseError):
diff --git a/spinta/manifests/tabular/helpers.py b/spinta/manifests/tabular/helpers.py
index efad9f90..a145c646 100644
--- a/spinta/manifests/tabular/helpers.py
+++ b/spinta/manifests/tabular/helpers.py
@@ -94,6 +94,7 @@ MAIN_DIMENSIONS = [
     'model',
     'property',
 ]
+
 EXTRA_DIMENSIONS = [
     '',
     'prefix',
@@ -105,6 +106,10 @@ EXTRA_DIMENSIONS = [
     'unique'
 ]
 
+ALLOWED_PARTIAL_TYPES = ['object', 'partial', 'ref']
+
+ALLOWED_ARRAY_TYPES = ['array', 'partial_array']
+
 
 class TabularManifestError(Exception):
     pass
@@ -595,6 +600,7 @@ class PropertyReader(TabularReader):
     enums: Set[str]
 
     def read(self, row: Dict[str, str]) -> None:
+        self.path_to_current_prop = self._path_to_current_prop(row['property'])
         full_prop, parent_prop, prop_name = _get_parent_data(self, row, row['property'])
         prop_data = _handle_datatype(self, row)
         if prop_data:
@@ -647,10 +653,15 @@ class PropertyReader(TabularReader):
             )
         )
 
-
-ALLOWED_PARTIAL_TYPES = ['object', 'partial', 'ref']
-ALLOWED_ARRAY_TYPES = ['array', 'partial_array']
-
+    def _path_to_current_prop(self, prop_given_name: str) -> str:
+        STR_PROPERTIES = 'properties'
+        parts = prop_given_name.split('.')[1:]
+        result = '.'.join(
+            part + ('.' + STR_PROPERTIES if i < len(parts) - 1 else '')
+            for i, part in enumerate(parts)
+        )
+        return STR_PROPERTIES + '.' + result if result else ''
+    
 
 def _initial_normal_property_schema(given_name: str, dtype: dict, row: dict):
     return {
@@ -1347,22 +1358,15 @@ class EnumReader(TabularReader):
             'description': row[DESCRIPTION],
         }
 
-        node = (
-            self.state.prop or
-            self.state.model or
-            self.state.base or
-            self.state.resource or
-            self.state.dataset or
-            self.state.manifest
-        )
+        node_data: PropertyRow = self._get_node_data(row)
 
-        if 'enums' not in node.data:
-            node.data['enums'] = {}
+        if 'enums' not in node_data:
+            node_data['enums'] = {}
 
-        if self.name not in node.data['enums']:
-            node.data['enums'][self.name] = {}
+        if self.name not in node_data['enums']:
+            node_data['enums'][self.name] = {}
 
-        enum = node.data['enums'][self.name]
+        enum = node_data['enums'][self.name]
 
         if source in enum:
             self.error(
@@ -1383,6 +1387,25 @@ class EnumReader(TabularReader):
     def leave(self) -> None:
         pass
 
+    def _get_node_data(self, row: ManifestRow) -> PropertyRow:
+        node: TabularReader = (
+            self.state.prop
+            or self.state.model
+            or self.state.base
+            or self.state.resource
+            or self.state.dataset
+            or self.state.manifest
+        )
+
+        node_data: PropertyRow = node.data
+
+        if isinstance(node, PropertyReader):
+            if node.path_to_current_prop:
+                for key in node.path_to_current_prop.split('.'):
+                    node_data = node_data[key]
+
+        return node_data
+
 
 class LangReader(TabularReader):
     type: str = 'lang'
diff --git a/spinta/manifests/xsd/helpers.py b/spinta/manifests/xsd/helpers.py
index 96737986..9e3b9a40 100644
--- a/spinta/manifests/xsd/helpers.py
+++ b/spinta/manifests/xsd/helpers.py
@@ -81,20 +81,6 @@ DATATYPES_MAPPING = {
 
 
 class XSDModel:
-    deduplicate: Deduplicator
-    xsd: 'XSDReader'
-    dataset_name: str
-    node: _Element
-    type: str = "model"
-    name: str | None = None
-    basename: str | None = None
-    external: dict | None = None
-    properties: dict | None = None
-    uri: str | None = None
-    description: str | None = None
-    root_properties: dict | None = None
-    parent_model: XSDModel | None = None
-    is_root_model: bool | None = None
     """
     Class for creating and handling DSA models from XSD files.
 
@@ -111,16 +97,20 @@ class XSDModel:
 
     def __init__(self, xsd: 'XSDReader', node: _Element = None):
         self.deduplicate = Deduplicator()
+
         self.xsd: 'XSDReader' = xsd
         self.dataset_name: str = xsd.dataset_name
         self.node: _Element = node
-
-    def __eq__(self, other: XSDModel) -> bool:
-        if self.external["name"] != other.external["name"]:
-            return False
-        if self.properties != other.properties:
-            return False
-        return True
+        self.type: str = "model"
+        self.name: str | None = None
+        self.basename: str | None = None
+        self.external: dict | None = None
+        self.properties: dict | None = None
+        self.uri: str | None = None
+        self.description: str | None = None
+        self.root_properties: dict | None = None
+        self.parent_model: XSDModel | None = None
+        self.is_root_model: bool | None = None
 
     def get_data(self):
         model_data: dict = {
@@ -865,31 +855,10 @@ class XSDReader:
                     referenced_model = self.models[prop["model"]]
                     referenced_model.add_ref_property(model)
 
-    def _sort_properties_alphabetically(self):
+    def _sort_properties_alpabetically(self):
         for model in self.models.values():
             model.properties = dict(sorted(model.properties.items()))
 
-    def _remove_duplicate_models(self):
-        """removes models that are exactly the same"""
-
-        model_pairs = {}
-
-        for model_name, model in self.models.items():
-            for another_model_name, another_model in self.models.items():
-                if model is not another_model and model == another_model:
-                    if another_model_name not in model_pairs.values() and another_model_name not in model_pairs:
-                        model_pairs[another_model_name] = model_name
-
-        for another_model_name, model_name in model_pairs.items():
-            parent_model = self.models[another_model_name].parent_model
-            if parent_model:
-                for property_id, prop in parent_model.properties.items():
-                    if "model" in prop and prop["model"] == another_model_name:
-                        prop["model"] = model_name
-                        if not self.models[model_name].parent_model:
-                            self.models[model_name].parent_model = self.models[model_name].parent_model
-                        self.models.pop(another_model_name)
-
     def start(self):
         self._extract_root()
 
@@ -899,19 +868,13 @@ class XSDReader:
 
         self._parse_root_node()
 
-        # models transformations
-
         self._remove_unneeded_models()
 
-        self.models = dict(sorted(self.models.items()))
-
-        self._remove_duplicate_models()
-
         self._compile_nested_properties()
 
         self._add_refs_for_backrefs()
 
-        self._sort_properties_alphabetically()
+        self._sort_properties_alpabetically()
 
     def remove_extra_root_models(self, model: XSDModel) -> XSDModel:
         """
diff --git a/spinta/types/geometry/helpers.py b/spinta/types/geometry/helpers.py
deleted file mode 100644
index 7eaa1a3f..00000000
--- a/spinta/types/geometry/helpers.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from functools import lru_cache
-
-import shapely
-from pyproj import CRS, Transformer
-
-
-@lru_cache
-def is_crs_always_xy(srid: int) -> bool:
-    crs = CRS.from_user_input(srid)
-    # Pseudo-Mercator WGS 84, always east, north
-    crs_wgs84 = CRS.from_user_input(3857)
-
-    transformer = Transformer.from_crs(crs, crs_wgs84)
-    transformer_xy = Transformer.from_crs(crs, crs_wgs84, always_xy=True)
-
-    transformed = transformer.transform(10, 20)
-    transformer_xy = transformer_xy.transform(10, 20)
-
-    return transformed == transformer_xy
-
-
-@lru_cache
-def get_crs_bounding_area(srid: int) -> shapely.geometry.Polygon:
-    crs = CRS.from_user_input(srid)
-    transformer = Transformer.from_crs(crs.geodetic_crs, crs, always_xy=True)
-    west, south, east, north = transformer.transform_bounds(*crs.area_of_use.bounds)
-
-    is_lon_lat = is_crs_always_xy(srid)
-
-    if is_lon_lat:
-        return shapely.geometry.box(
-            minx=west,
-            maxx=east,
-            miny=south,
-            maxy=north
-        )
-
-    return shapely.geometry.box(
-        minx=south,
-        maxx=north,
-        miny=west,
-        maxy=east
-    )


Test patch:
diff --git a/tests/backends/postgresql/commands/test_summary.py b/tests/backends/postgresql/commands/test_summary.py
index 51d12480..962a99e8 100644
--- a/tests/backends/postgresql/commands/test_summary.py
+++ b/tests/backends/postgresql/commands/test_summary.py
@@ -1462,28 +1462,28 @@ def test_summary_geometry_with_srid(rc: RawConfig, postgresql: str, request: Fix
             ''', backend=postgresql, request=request)
     app = create_test_client(context)
     app.authmodel('example/summary/geometry_srid', ['insert', 'getall', 'search'])
-    app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(6000000.15 180000.05)'})
-    app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(6000000.15 180000.05)'})
-    resp_10_20 = app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(6200000.05 200000.15)'})
-    resp_40_80 = app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(6200000.05 400000.15)'})
+    app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(180000.05 6000000.15)'})
+    app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(180000.05 6000000.15)'})
+    resp_10_20 = app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(200000.15 6200000.05)'})
+    resp_40_80 = app.post('/example/summary/geometry_srid/Test', json={'value': 'POINT(400000.15 6200000.05)'})
     response = app.get('/example/summary/geometry_srid/Test/:summary/value')
     json_response = response.json()
 
     assert len(json_response["_data"]) == 3
     assert dict_equals(json_response["_data"][0], {
         'cluster': 2,
-        'centroid': 'POINT(6000000.15 180000.05)',
+        'centroid': 'POINT(180000.05 6000000.15)',
         '_type': 'example/summary/geometry_srid/Test'
     })
     assert dict_equals(json_response["_data"][1], {
         'cluster': 1,
-        'centroid': 'POINT(6200000.05 200000.15)',
+        'centroid': 'POINT(200000.15 6200000.05)',
         "_id": resp_10_20.json()["_id"],
         '_type': 'example/summary/geometry_srid/Test'
     })
     assert dict_equals(json_response["_data"][2], {
         'cluster': 1,
-        'centroid': 'POINT(6200000.05 400000.15)',
+        'centroid': 'POINT(400000.15 6200000.05)',
         "_id": resp_40_80.json()["_id"],
         '_type': 'example/summary/geometry_srid/Test'
     })
@@ -1680,28 +1680,28 @@ def test_summary_geometry_bbox_with_srid(rc: RawConfig, postgresql: str, request
     app = create_test_client(context)
 
     app.authmodel('example/summary/geometry', ['insert', 'getall', 'search'])
-    app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 180000.05)'})
-    app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 180000.05)'})
-    resp_10_20 = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6200000.05 200000.15)'})
-    resp_40_80 = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6200000.05 400000.15)'})
-    response = app.get('/example/summary/geometry/TestSrid/:summary/value?bbox(6000000, 180000, 6200001, 400001)')
+    app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(180000.05 6000000.15)'})
+    app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(180000.05 6000000.15)'})
+    resp_10_20 = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(200000.15 6200000.05)'})
+    resp_40_80 = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(400000.15 6200000.05)'})
+    response = app.get('/example/summary/geometry/TestSrid/:summary/value?bbox(180000, 6000000, 400001, 6200001)')
     json_response = response.json()
 
     assert len(json_response["_data"]) == 3
     assert dict_equals(json_response["_data"][0], {
         'cluster': 2,
-        'centroid': 'POINT(6000000.15 180000.05)',
+        'centroid': 'POINT(180000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][1], {
         'cluster': 1,
-        'centroid': 'POINT(6200000.05 200000.15)',
+        'centroid': 'POINT(200000.15 6200000.05)',
         "_id": resp_10_20.json()["_id"],
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][2], {
         'cluster': 1,
-        'centroid': 'POINT(6200000.05 400000.15)',
+        'centroid': 'POINT(400000.15 6200000.05)',
         "_id": resp_40_80.json()["_id"],
         '_type': 'example/summary/geometry/TestSrid'
     })
@@ -1752,23 +1752,23 @@ def test_summary_geometry_under_unique_limit(rc: RawConfig, postgresql: str, req
 
     app.authmodel('example/summary/geometry', ['insert', 'getall', 'search'])
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 180000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(180000.05 6000000.15)'})
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 190000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(190000.05 6000000.15)'})
     for i in range(20):
-        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(6000000.15 180010.{i*2 + 1})'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(180010.{i*2 + 1} 6000000.15)'})
 
     response = app.get('/example/summary/geometry/TestSrid/:summary/value')
     json_response = response.json()
     assert len(json_response["_data"]) == 22
     assert dict_equals(json_response["_data"][0], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 180000.05)',
+        'centroid': 'POINT(180000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][1], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 190000.05)',
+        'centroid': 'POINT(190000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert sum([item['cluster'] for item in json_response["_data"]]) == 30
@@ -1785,23 +1785,23 @@ def test_summary_geometry_over_unique_limit(rc: RawConfig, postgresql: str, requ
 
     app.authmodel('example/summary/geometry', ['insert', 'getall', 'search'])
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 180000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(180000.05 6000000.15)'})
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 190000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(190000.05 6000000.15)'})
     for i in range(40):
-        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(6000000.15 180010.{i*2 + 1})'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(180010.{i*2 + 1} 6000000.15)'})
 
     response = app.get('/example/summary/geometry/TestSrid/:summary/value')
     json_response = response.json()
     assert len(json_response["_data"]) == 25
     assert dict_equals(json_response["_data"][0], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 180000.05)',
+        'centroid': 'POINT(180000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][1], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 190000.05)',
+        'centroid': 'POINT(190000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert sum([item['cluster'] for item in json_response["_data"]]) == 50
@@ -1818,30 +1818,30 @@ def test_summary_geometry_under_unique_limit_bbox(rc: RawConfig, postgresql: str
 
     app.authmodel('example/summary/geometry', ['insert', 'getall', 'search'])
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 180000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(180000.05 6000000.15)'})
     for i in range(5):
-        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6000000.15 190000.05)'})
-    resp = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(6010000.15 194000.05)'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(190000.05 6000000.15)'})
+    resp = app.post('/example/summary/geometry/TestSrid', json={'value': 'POINT(194000.05 6010000.15)'})
     for i in range(39):
-        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(6000000.15 200010.{i*2 + 1})'})
+        app.post('/example/summary/geometry/TestSrid', json={'value': f'POINT(200010.{i*2 + 1} 6000000.15)'})
 
-    response = app.get('/example/summary/geometry/TestSrid/:summary/value?bbox(6000000, 180000, 6200001, 195000)')
+    response = app.get('/example/summary/geometry/TestSrid/:summary/value?bbox(180000, 6000000, 195000, 6200001)')
     json_response = response.json()
     assert len(json_response["_data"]) == 3
     assert dict_equals(json_response["_data"][0], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 180000.05)',
+        'centroid': 'POINT(180000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][1], {
         'cluster': 5,
-        'centroid': 'POINT(6000000.15 190000.05)',
+        'centroid': 'POINT(190000.05 6000000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert dict_equals(json_response["_data"][2], {
         '_id': resp.json()['_id'],
         'cluster': 1,
-        'centroid': 'POINT(6010000.15 194000.05)',
+        'centroid': 'POINT(194000.05 6010000.15)',
         '_type': 'example/summary/geometry/TestSrid'
     })
     assert sum([item['cluster'] for item in json_response["_data"]]) == 11
diff --git a/tests/dtypes/test_geometry.py b/tests/dtypes/test_geometry.py
index 3dac4ca4..3f33764d 100644
--- a/tests/dtypes/test_geometry.py
+++ b/tests/dtypes/test_geometry.py
@@ -25,7 +25,6 @@ from spinta.testing.manifest import load_manifest
 from spinta.testing.manifest import load_manifest_get_context
 from spinta.testing.types.geometry import round_point, round_url
 from spinta.types.geometry.constants import WGS84, LKS94
-from spinta.types.geometry.helpers import is_crs_always_xy, get_crs_bounding_area
 
 
 @pytest.mark.manifests('internal_sql', 'csv')
@@ -169,7 +168,7 @@ def test_geometry_params_srid(
     # Write data
     resp = app.post(f'/{model}', json={
         'name': "Vilnius",
-        'coordinates': 'SRID=3346;POINT(6000000 180000)',
+        'coordinates': 'SRID=3346;POINT(180000 6000000)',
     })
     assert resp.status_code == 201
 
@@ -371,7 +370,7 @@ def test_geometry_params_with_srid_without_srid(
     ])
 
     resp = app.post(f'/{model}', json={
-        'point': 'POINT(6000000 180000)',
+        'point': 'POINT(180000 6000000)',
     })
     assert resp.status_code == 201
 
@@ -429,33 +428,6 @@ def test_srid_service(
     assert y[:8] == '25.28668'
 
 
-@pytest.mark.manifests('internal_sql', 'csv')
-def test_srid_service_negative_values(
-    manifest_type: str,
-    tmp_path: Path,
-    rc: RawConfig,
-    postgresql: str,
-):
-    context = load_manifest_get_context(rc, '''
-    d | r | b | m | property | type | ref
-    ''', manifest_type=manifest_type, tmp_path=tmp_path)
-
-    app = create_test_client(context)
-
-    resp = app.get(f'/_srid/2770/-68600.50/-16700.10', follow_redirects=False)
-    assert resp.status_code == 307
-
-    purl = urllib.parse.urlparse(resp.headers['location'])
-    query = urllib.parse.parse_qs(purl.query)
-    x, y = query['mlat'][0], query['mlon'][0]
-    assert x[:8] == '26.92553'
-    assert y[:8] == '-138.789'
-
-    _, x, y = purl.fragment.split('/')
-    assert x[:8] == '26.92553'
-    assert y[:8] == '-138.789'
-
-
 @pytest.mark.manifests('internal_sql', 'csv')
 def test_geometry_delete(
     manifest_type: str,
@@ -617,144 +589,9 @@ def test_geometry_write_out_of_bounds(
     assert resp.status_code == 400
     assert resp.json()['errors'][0]['code'] == 'CoordinatesOutOfRange'
 
-    resp = app.post(f'/{model}', json={
-        "number": 0,
-        "point": "Point(400000 6000000)"
-    })
-    assert resp.status_code == 400
-    assert resp.json()['errors'][0]['code'] == 'CoordinatesOutOfRange'
-
     resp = app.post(f'/{model}', json={
         "number": 0,
         "point_1": "Point(-181 0)"
     })
     assert resp.status_code == 400
     assert resp.json()['errors'][0]['code'] == 'CoordinatesOutOfRange'
-
-
-def test_geometry_write_within_bounds(
-    rc: RawConfig,
-    postgresql: str,
-    request: FixtureRequest,
-):
-    context = bootstrap_manifest(rc, f'''
-        d | r | b | m | property                | type           | access
-        backends/postgres/dtypes/geometry/within |                | 
-          |   |   | Point                       |                | 
-          |   |   |   | point                   | geometry(3346) | open
-          |   |   |   | point_1                 | geometry       | open
-          |   |   |   | point_2                 | geometry(3857) | open
-          |   |   |   | number                  | integer        | open
-    ''', backend=postgresql, request=request)
-
-    ns: str = 'backends/postgres/dtypes/geometry/within'
-    model: str = f'{ns}/Point'
-
-    app = create_test_client(context)
-    app.authmodel(model, [
-        'insert',
-        'update',
-        'patch'
-    ])
-
-    resp = app.post(f'/{model}', json={
-        "number": 0,
-        "point": "Point(6000000 400000)"
-    })
-    assert resp.status_code == 201
-
-    resp = app.post(f'/{model}', json={
-        "number": 0,
-        "point_1": "Point(0 60)"
-    })
-    assert resp.status_code == 201
-
-    resp = app.post(f'/{model}', json={
-        "number": 0,
-        "point_2": "Point(-20000000 20000000)"
-    })
-    assert resp.status_code == 201
-
-
-@pytest.mark.parametrize('srid, result', [
-    # WGS84 (3857) east, north
-    (3857, True),
-    # OSGB36 (27700), east, north
-    (27700, True),
-    # RGF93 (2154), east, north
-    (2154, True),
-    # ETRS89 (3067), east, north
-    (3067, True),
-    # CH1903+ / LV95 (2056), east, north
-    (2056, True),
-    # PSAD56 (24893), east, north
-    (24893, True),
-    # BD72 (31370), east, north
-    (31370, True),
-    # MGI (31283), north, east
-    (31283, False),
-    # WGS84 (4326) north, east
-    (4326, False),
-    # LKS94 (3346), north, east
-    (3346, False),
-    # Pulkovo 1942 (3120), north, east
-    (3120, False),
-    # LKS-92 (3059), north, east
-    (3059, False),
-    # Estonian Coordinate System of 1992 (3300), north, east
-    (3300, False),
-    # China Geodetic Coordinate System 2000 (4480), north, east
-    (4480, False),
-])
-def test_geometry_always_xy_function(
-    srid: int,
-    result: bool
-):
-    assert is_crs_always_xy(srid) == result
-
-
-@pytest.mark.parametrize('srid, bbox', [
-    # WGS84 (3857) east, north
-    (3857, shapely.geometry.box(
-        minx=-20037508.34,
-        maxx=20037508.34,
-        miny=-20048966.1,
-        maxy=20048966.1
-    )),
-    # RGF93 (2154), east, north
-    (2154, shapely.geometry.box(
-        minx=-378305.81,
-        maxx=1320649.57,
-        miny=6005281.2,
-        maxy=7235612.72
-    )),
-    # WGS84 (4326) north, east
-    (4326, shapely.geometry.box(
-        minx=-90.0,
-        maxx=90.0,
-        miny=-180,
-        maxy=180
-    )),
-    # LKS94 (3346), north, east
-    (3346, shapely.geometry.box(
-        minx=5972477.98,
-        maxx=6268543.17,
-        miny=172763.81,
-        maxy=685350.95
-    )),
-    # China Geodetic Coordinate System 2000 (4480), north, east
-    (4480, shapely.geometry.box(
-        minx=16.7,
-        maxx=53.56,
-        miny=73.62,
-        maxy=134.77
-    )),
-])
-def test_geometry_crs_bounding_area(
-    srid: int,
-    bbox: shapely.geometry.Polygon
-):
-    assert get_crs_bounding_area(srid).equals_exact(
-        bbox,
-        tolerance=0.1
-    )
diff --git a/tests/manifests/test_manifest.py b/tests/manifests/test_manifest.py
index 7509c86e..38a1ae2b 100644
--- a/tests/manifests/test_manifest.py
+++ b/tests/manifests/test_manifest.py
@@ -110,6 +110,27 @@ def test_enum(manifest_type, tmp_path, rc):
     ''', manifest_type)
 
 
+@pytest.mark.manifests('internal_sql', 'csv')
+def test_enum_nested(manifest_type, tmp_path, rc):
+    check(tmp_path, rc, '''
+        d | r | b | m | property   | type    | ref    | source | prepare
+        example                    |         |        |        |
+                                   |         |        |        |
+          |   |   | Option         |         | id     |        |
+          |   |   |   | id         | integer |        |        |
+                                   |         |        |        |
+          |   |   | Answer         |         | id     |        |
+          |   |   |   | id         | integer |        |        |
+          |   |   |   | opinion    | ref     | Option |        |
+          |   |   |   | opinion.o1 | integer |        |        |
+                                   | enum    |        |        | 1
+                                   |         |        |        | 0
+          |   |   |   | opinion.o2 | integer |        |        |
+                                   | enum    |        |        | 1
+                                   |         |        |        | 0
+    ''', manifest_type)
+
+
 @pytest.mark.manifests('internal_sql', 'csv')
 def test_enum_ref(manifest_type, tmp_path, rc):
     check(tmp_path, rc, '''
diff --git a/tests/manifests/xsd/test_xsd.py b/tests/manifests/xsd/test_xsd.py
index 9a24a00b..cce73a80 100644
--- a/tests/manifests/xsd/test_xsd.py
+++ b/tests/manifests/xsd/test_xsd.py
@@ -5,6 +5,7 @@ from spinta.testing.manifest import load_manifest
 
 
 def test_xsd(rc: RawConfig, tmp_path: Path):
+
     xsd = """
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="ADMINISTRACINIAI">
@@ -15,6 +16,16 @@ def test_xsd(rc: RawConfig, tmp_path: Path):
             <xs:sequence>
               <xs:element type="xs:long" name="ADM_KODAS"/>
               <xs:element type="xs:long" name="ADM_ID"/>
+              <xs:element type="xs:string" name="TIPAS"/>
+              <xs:element type="xs:string" name="TIPO_SANTRUMPA"/>
+              <xs:element type="xs:string" name="VARDAS_K"/>
+              <xs:element type="xs:string" name="VARDAS_K_LOT"/>
+              <xs:element type="xs:long" name="PRIKLAUSO_KODAS"/>
+              <xs:element type="xs:long" name="GYV_KODAS"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
+              <xs:element type="xs:date" name="ADM_NUO"/>
+              <xs:element type="xs:date" name="ADM_IKI"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>
@@ -29,6 +40,99 @@ def test_xsd(rc: RawConfig, tmp_path: Path):
             <xs:sequence>
               <xs:element type="xs:long" name="GYV_KODAS"/>
               <xs:element type="xs:long" name="GYV_ID"/>
+              <xs:element type="xs:string" name="TIPAS"/>
+              <xs:element type="xs:string" name="TIPO_SANTRUMPA"/>
+              <xs:element type="xs:string" name="VARDAS_V"/>
+              <xs:element type="xs:string" name="VARDAS_V_LOT"/>
+              <xs:element type="xs:string" name="VARDAS_K"/>
+              <xs:element type="xs:string" name="VARDAS_K_LOT"/>
+              <xs:element type="xs:long" name="ADM_KODAS"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
+              <xs:element type="xs:date" name="GYV_NUO"/>
+              <xs:element type="xs:date" name="GYV_IKI"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="GATVES">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="GATVE" maxOccurs="unbounded" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element type="xs:long" name="GAT_KODAS"/>
+              <xs:element type="xs:long" name="GAT_ID"/>
+              <xs:element type="xs:string" name="TIPAS"/>
+              <xs:element type="xs:string" name="TIPO_SANTRUMPA"/>
+              <xs:element type="xs:string" name="VARDAS_K"/>
+              <xs:element type="xs:string" name="VARDAS_K_LOT"/>
+              <xs:element type="xs:long" name="GYV_KODAS"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
+              <xs:element type="xs:date" name="GAT_NUO"/>
+              <xs:element type="xs:date" name="GAT_IKI"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ADRESAI">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="ADRESAS" maxOccurs="unbounded" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element type="xs:long" name="AOB_KODAS"/>
+              <xs:element type="xs:long" name="AOB_ID"/>
+              <xs:element type="xs:long" name="GYV_KODAS"/>
+              <xs:element type="xs:long" name="GAT_KODAS"/>
+              <xs:element type="xs:string" name="NR"/>
+              <xs:element type="xs:string" name="KORPUSO_NR"/>
+              <xs:element type="xs:string" name="PASTO_KODAS"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
+              <xs:element type="xs:date" name="AOB_NUO"/>
+              <xs:element type="xs:date" name="AOB_IKI"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="PATALPOS">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="PATALPA" maxOccurs="unbounded" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element type="xs:long" name="PAT_KODAS"/>
+              <xs:element type="xs:long" name="PAT_ID"/>
+              <xs:element type="xs:long" name="AOB_KODAS"/>
+              <xs:element type="xs:string" name="PATALPOS_NR"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
+              <xs:element type="xs:date" name="PAT_NUO"/>
+              <xs:element type="xs:date" name="PAT_IKI"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="KODAI">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="KODAS" maxOccurs="unbounded" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element type="xs:string" name="PASTO_KODAS"/>
+              <xs:element type="xs:string" name="PASTO_VIET_PAV"/>
+              <xs:element type="xs:date" name="NUO"/>
+              <xs:element type="xs:date" name="IKI"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>
@@ -45,11 +149,74 @@ def test_xsd(rc: RawConfig, tmp_path: Path):
     |                                 |                  |     |                                   |         |       |        |     |       |
     |   |   |   | Administracinis     |                  |     | /ADMINISTRACINIAI/ADMINISTRACINIS |         |       |        |     |       |
     |   |   |   |   | adm_id          | integer required |     | ADM_ID/text()                     |         |       |        |     |       |
+    |   |   |   |   | adm_iki         | date required    |     | ADM_IKI/text()                    |         |       |        |     |       |
     |   |   |   |   | adm_kodas       | integer required |     | ADM_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | adm_nuo         | date required    |     | ADM_NUO/text()                    |         |       |        |     |       |
+    |   |   |   |   | gyv_kodas       | integer required |     | GYV_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | priklauso_kodas | integer required |     | PRIKLAUSO_KODAS/text()            |         |       |        |     |       |
+    |   |   |   |   | tipas           | string required  |     | TIPAS/text()                      |         |       |        |     |       |
+    |   |   |   |   | tipo_santrumpa  | string required  |     | TIPO_SANTRUMPA/text()             |         |       |        |     |       |
+    |   |   |   |   | vardas_k        | string required  |     | VARDAS_K/text()                   |         |       |        |     |       |
+    |   |   |   |   | vardas_k_lot    | string required  |     | VARDAS_K_LOT/text()               |         |       |        |     |       |
     |                                 |                  |     |                                   |         |       |        |     |       |
     |   |   |   | Gyvenviete          |                  |     | /GYVENVIETES/GYVENVIETE           |         |       |        |     |       |
+    |   |   |   |   | adm_kodas       | integer required |     | ADM_KODAS/text()                  |         |       |        |     |       |
     |   |   |   |   | gyv_id          | integer required |     | GYV_ID/text()                     |         |       |        |     |       |
+    |   |   |   |   | gyv_iki         | date required    |     | GYV_IKI/text()                    |         |       |        |     |       |
+    |   |   |   |   | gyv_kodas       | integer required |     | GYV_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | gyv_nuo         | date required    |     | GYV_NUO/text()                    |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | tipas           | string required  |     | TIPAS/text()                      |         |       |        |     |       |
+    |   |   |   |   | tipo_santrumpa  | string required  |     | TIPO_SANTRUMPA/text()             |         |       |        |     |       |
+    |   |   |   |   | vardas_k        | string required  |     | VARDAS_K/text()                   |         |       |        |     |       |
+    |   |   |   |   | vardas_k_lot    | string required  |     | VARDAS_K_LOT/text()               |         |       |        |     |       |
+    |   |   |   |   | vardas_v        | string required  |     | VARDAS_V/text()                   |         |       |        |     |       |
+    |   |   |   |   | vardas_v_lot    | string required  |     | VARDAS_V_LOT/text()               |         |       |        |     |       |
+    |                                 |                  |     |                                   |         |       |        |     |       |
+    |   |   |   | Gatve               |                  |     | /GATVES/GATVE                     |         |       |        |     |       |
+    |   |   |   |   | gat_id          | integer required |     | GAT_ID/text()                     |         |       |        |     |       |
+    |   |   |   |   | gat_iki         | date required    |     | GAT_IKI/text()                    |         |       |        |     |       |
+    |   |   |   |   | gat_kodas       | integer required |     | GAT_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | gat_nuo         | date required    |     | GAT_NUO/text()                    |         |       |        |     |       |
     |   |   |   |   | gyv_kodas       | integer required |     | GYV_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | tipas           | string required  |     | TIPAS/text()                      |         |       |        |     |       |
+    |   |   |   |   | tipo_santrumpa  | string required  |     | TIPO_SANTRUMPA/text()             |         |       |        |     |       |
+    |   |   |   |   | vardas_k        | string required  |     | VARDAS_K/text()                   |         |       |        |     |       |
+    |   |   |   |   | vardas_k_lot    | string required  |     | VARDAS_K_LOT/text()               |         |       |        |     |       |
+    |                                 |                  |     |                                   |         |       |        |     |       |
+    |   |   |   | Adresas             |                  |     | /ADRESAI/ADRESAS                  |         |       |        |     |       |
+    |   |   |   |   | aob_id          | integer required |     | AOB_ID/text()                     |         |       |        |     |       |
+    |   |   |   |   | aob_iki         | date required    |     | AOB_IKI/text()                    |         |       |        |     |       |
+    |   |   |   |   | aob_kodas       | integer required |     | AOB_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | aob_nuo         | date required    |     | AOB_NUO/text()                    |         |       |        |     |       |
+    |   |   |   |   | gat_kodas       | integer required |     | GAT_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | gyv_kodas       | integer required |     | GYV_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | korpuso_nr      | string required  |     | KORPUSO_NR/text()                 |         |       |        |     |       |
+    |   |   |   |   | nr              | string required  |     | NR/text()                         |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | pasto_kodas     | string required  |     | PASTO_KODAS/text()                |         |       |        |     |       |
+    |                                 |                  |     |                                   |         |       |        |     |       |
+    |   |   |   | Patalpa             |                  |     | /PATALPOS/PATALPA                 |         |       |        |     |       |
+    |   |   |   |   | aob_kodas       | integer required |     | AOB_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | pat_id          | integer required |     | PAT_ID/text()                     |         |       |        |     |       |
+    |   |   |   |   | pat_iki         | date required    |     | PAT_IKI/text()                    |         |       |        |     |       |
+    |   |   |   |   | pat_kodas       | integer required |     | PAT_KODAS/text()                  |         |       |        |     |       |
+    |   |   |   |   | pat_nuo         | date required    |     | PAT_NUO/text()                    |         |       |        |     |       |
+    |   |   |   |   | patalpos_nr     | string required  |     | PATALPOS_NR/text()                |         |       |        |     |       |
+    |                                 |                  |     |                                   |         |       |        |     |       |
+    |   |   |   | Kodas               |                  |     | /KODAI/KODAS                      |         |       |        |     |       |
+    |   |   |   |   | iki             | date required    |     | IKI/text()                        |         |       |        |     |       |
+    |   |   |   |   | nuo             | date required    |     | NUO/text()                        |         |       |        |     |       |
+    |   |   |   |   | pasto_kodas     | string required  |     | PASTO_KODAS/text()                |         |       |        |     |       |
+    |   |   |   |   | pasto_viet_pav  | string required  |     | PASTO_VIET_PAV/text()             |         |       |        |     |       |
 """
     path = tmp_path / 'manifest.xsd'
     with open(path, "w") as xsd_file:
@@ -59,52 +226,78 @@ def test_xsd(rc: RawConfig, tmp_path: Path):
 
 
 def test_xsd_ref(rc: RawConfig, tmp_path: Path):
+
     xsd = """
 
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+
+<xs:element name="klientu_saraso_rezultatas">
+  <xs:complexType mixed="true">
+    <xs:sequence>
+      <xs:element ref="asmenys" minOccurs="0" maxOccurs="1" />
+    </xs:sequence>
+  </xs:complexType>
+</xs:element>
+
+
 <xs:element name="asmenys">
   <xs:complexType mixed="true">
     <xs:sequence>
       <xs:element ref="asmuo" minOccurs="0" maxOccurs="unbounded" />
     </xs:sequence>
+
     <xs:attribute name="puslapis" type="xs:long" use="required">
       <xs:annotation><xs:documentation>rezultatu puslapio numeris</xs:documentation></xs:annotation>
     </xs:attribute>
+
   </xs:complexType>
 </xs:element>
 
+
+
 <xs:element name="asmuo">
   <xs:complexType mixed="true">
 
       <xs:attribute name="id"     type="xs:string" use="required">
       </xs:attribute>
+
       <xs:attribute name="ak"  type="xs:string" use="required">
       </xs:attribute>
 
   </xs:complexType>
 </xs:element>
+
+
 </xs:schema>
     """
 
     table = """
- id | d | r | b | m | property     | type             | ref     | source         | prepare | level | access | uri | title | description
-    | manifest                     |                  |         |                |         |       |        |     |       |
-    |   | resource1                | xml              |         |                |         |       |        |     |       |
-    |                              |                  |         |                |         |       |        |     |       |
-    |   |   |   | Asmenys          |                  |         | /asmenys       |         |       |        |     |       |
-    |   |   |   |   | asmuo[]      | backref          | Asmuo   | asmuo          |         |       |        |     |       |
-    |   |   |   |   | asmuo[].ak   | string required  |         | @ak            |         |       |        |     |       |
-    |   |   |   |   | asmuo[].id   | string required  |         | @id            |         |       |        |     |       |
-    |   |   |   |   | asmuo[].text | string           |         | text()         |         |       |        |     |       |
-    |   |   |   |   | puslapis     | integer required |         | @puslapis      |         |       |        |     |       | rezultatu puslapio numeris
-    |   |   |   |   | text         | string           |         | text()         |         |       |        |     |       |
-    |                              |                  |         |                |         |       |        |     |       |
-    |   |   |   | Asmuo            |                  |         | /asmenys/asmuo |         |       |        |     |       |
-    |   |   |   |   | ak           | string required  |         | @ak            |         |       |        |     |       |
-    |   |   |   |   | asmenys      | ref              | Asmenys |                |         |       |        |     |       |
-    |   |   |   |   | id           | string required  |         | @id            |         |       |        |     |       |
-    |   |   |   |   | text         | string           |         | text()         |         |       |        |     |       |
-
+ id | d | r | b | m | property                  | type             | ref                     | source                                   | prepare | level | access | uri | title | description
+    | manifest                                  |                  |                         |                                          |         |       |        |     |       |
+    |   | resource1                             | xml              |                         |                                          |         |       |        |     |       |
+    |                                           |                  |                         |                                          |         |       |        |     |       |
+    |   |   |   | KlientuSarasoRezultatas       |                  |                         | /klientu_saraso_rezultatas               |         |       |        |     |       |
+    |   |   |   |   | asmenys                   | ref              | Asmenys                 | asmenys                                  |         |       |        |     |       |
+    |   |   |   |   | asmenys.asmuo[]           | backref          | Asmuo                   | asmenys/asmuo                            |         |       |        |     |       |
+    |   |   |   |   | asmenys.asmuo[].ak        | string required  |                         | @ak                                      |         |       |        |     |       |
+    |   |   |   |   | asmenys.asmuo[].id        | string required  |                         | @id                                      |         |       |        |     |       |
+    |   |   |   |   | asmenys.asmuo[].text      | string           |                         | text()                                   |         |       |        |     |       |
+    |   |   |   |   | asmenys.puslapis          | integer required |                         | asmenys/@puslapis                        |         |       |        |     |       | rezultatu puslapio numeris
+    |   |   |   |   | asmenys.text              | string           |                         | asmenys/text()                           |         |       |        |     |       |
+    |   |   |   |   | text                      | string           |                         | text()                                   |         |       |        |     |       |
+    |                                           |                  |                         |                                          |         |       |        |     |       |
+    |   |   |   | Asmenys                       |                  |                         | /klientu_saraso_rezultatas/asmenys       |         |       |        |     |       |
+    |   |   |   |   | asmuo[]                   | backref          | Asmuo                   | asmuo                                    |         |       |        |     |       |
+    |   |   |   |   | puslapis                  | integer required |                         | @puslapis                                |         |       |        |     |       | rezultatu puslapio numeris
+    |   |   |   |   | text                      | string           |                         | text()                                   |         |       |        |     |       |
+    |                                           |                  |                         |                                          |         |       |        |     |       |
+    |   |   |   | Asmuo                         |                  |                         | /klientu_saraso_rezultatas/asmenys/asmuo |         |       |        |     |       |
+    |   |   |   |   | ak                        | string required  |                         | @ak                                      |         |       |        |     |       |
+    |   |   |   |   | asmenys                   | ref              | Asmenys                 |                                          |         |       |        |     |       |
+    |   |   |   |   | id                        | string required  |                         | @id                                      |         |       |        |     |       |
+    |   |   |   |   | klientu_saraso_rezultatas | ref              | KlientuSarasoRezultatas |                                          |         |       |        |     |       |
+    |   |   |   |   | text                      | string           |                         | text()                                   |         |       |        |     |       |
 """
 
     path = tmp_path / 'manifest.xsd'
@@ -116,10 +309,19 @@ def test_xsd_ref(rc: RawConfig, tmp_path: Path):
 
 
 def test_xsd_resource_model(rc: RawConfig, tmp_path: Path):
+
     xsd = """
 
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 
+<xs:element name="klientu_saraso_rezultatas">
+  <xs:complexType mixed="true">
+    <xs:sequence>
+      <xs:element ref="asmenys"               minOccurs="0" maxOccurs="1" />
+    </xs:sequence>
+  </xs:complexType>
+</xs:element>
+
 <xs:element name="klaida" type="xs:string">
   <xs:annotation><xs:documentation>Klaidos atveju - klaidos pranešimas</xs:documentation></xs:annotation>
 </xs:element>
@@ -138,16 +340,22 @@ def test_xsd_resource_model(rc: RawConfig, tmp_path: Path):
     """
 
     table = """
- id | d | r | b | m | property | type             | ref | source        | prepare | level | access | uri                                           | title | description
-    | manifest                 |                  |     |               |         |       |        |                                               |       |
-    |   | resource1            | xml              |     |               |         |       |        |                                               |       |
-    |                          |                  |     |               |         |       |        |                                               |       |
-    |   |   |   | Asmenys      |                  |     | /asmenys      |         |       |        |                                               |       |
-    |   |   |   |   | puslapis | integer required |     | @puslapis     |         |       |        |                                               |       | rezultatu puslapio numeris
-    |   |   |   |   | text     | string           |     | text()        |         |       |        |                                               |       |
-    |                          |                  |     |               |         |       |        |                                               |       |
-    |   |   |   | Resource     |                  |     | /             |         |       |        | http://www.w3.org/2000/01/rdf-schema#Resource |       | Įvairūs duomenys
-    |   |   |   |   | klaida   | string           |     | klaida/text() |         |       |        |                                               |       | Klaidos atveju - klaidos pranešimas
+ id | d | r | b | m | property                | type             | ref     | source                             | prepare | level | access | uri                                           | title | description
+    | manifest                                |                  |         |                                    |         |       |        |                                               |       |
+    |   | resource1                           | xml              |         |                                    |         |       |        |                                               |       |
+    |                                         |                  |         |                                    |         |       |        |                                               |       |
+    |   |   |   | Resource                    |                  |         | /                                  |         |       |        | http://www.w3.org/2000/01/rdf-schema#Resource |       | Įvairūs duomenys
+    |   |   |   |   | klaida                  | string           |         | klaida/text()                      |         |       |        |                                               |       | Klaidos atveju - klaidos pranešimas
+    |                                         |                  |         |                                    |         |       |        |                                               |       |
+    |   |   |   | KlientuSarasoRezultatas     |                  |         | /klientu_saraso_rezultatas         |         |       |        |                                               |       |
+    |   |   |   |   | asmenys                 | ref              | Asmenys | asmenys                            |         |       |        |                                               |       |
+    |   |   |   |   | asmenys.puslapis        | integer required |         | asmenys/@puslapis                  |         |       |        |                                               |       | rezultatu puslapio numeris
+    |   |   |   |   | asmenys.text            | string           |         | asmenys/text()                     |         |       |        |                                               |       |
+    |   |   |   |   | text                    | string           |         | text()                             |         |       |        |                                               |       |
+    |                                         |                  |         |                                    |         |       |        |                                               |       |
+    |   |   |   | Asmenys                     |                  |         | /klientu_saraso_rezultatas/asmenys |         |       |        |                                               |       |
+    |   |   |   |   | puslapis                | integer required |         | @puslapis                          |         |       |        |                                               |       | rezultatu puslapio numeris
+    |   |   |   |   | text                    | string           |         | text()                             |         |       |        |                                               |       |
 
 """
 
@@ -160,6 +368,7 @@ def test_xsd_resource_model(rc: RawConfig, tmp_path: Path):
 
 
 def test_xsd_separate_type(rc: RawConfig, tmp_path: Path):
+
     xsd = """
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
@@ -214,8 +423,19 @@ id | d | r | b | m | property            | type            | ref              |
 
 
 def test_xsd_choice(rc: RawConfig, tmp_path: Path):
+
     xsd = """
     <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xs:element name="parcels">
+		<xs:annotation>
+			<xs:documentation>Pasikeitusių žemės sklypų sąrašas</xs:documentation>
+		</xs:annotation>
+		<xs:complexType mixed="true">
+			<xs:sequence>
+				<xs:element ref="parcel" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
 	<xs:element name="parcel">
 		<xs:annotation>
 			<xs:documentation>Žemės sklypo pasikeitimo informacija</xs:documentation>
@@ -240,6 +460,7 @@ def test_xsd_choice(rc: RawConfig, tmp_path: Path):
 						<xs:restriction base="xs:int">
 							<xs:enumeration value="1"/> <!-- nauji sklypai 	  -->
 							<xs:enumeration value="2"/> <!-- redaguoti sklypai -->
+							<xs:enumeration value="3"/> <!-- anuliuoti sklypai -->
 						</xs:restriction>
 					</xs:simpleType>
 				</xs:element>
@@ -250,19 +471,34 @@ def test_xsd_choice(rc: RawConfig, tmp_path: Path):
     """
 
     table = """
- id | d | r | b | m | property             | type             | ref | source                      | prepare | level | access | uri | title | description
-    | manifest                             |                  |     |                             |         |       |        |     |       |
-    |   | resource1                        | xml              |     |                             |         |       |        |     |       |
-    |                                      |                  |     |                             |         |       |        |     |       |
-    |   |   |   | Parcel1                  |                  |     | /parcel                     |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
-    |   |   |   |   | parcel_unique_number | integer required |     | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
-    |   |   |   |   | text                 | string           |     | text()                      |         |       |        |     |       |
-    |                                      |                  |     |                             |         |       |        |     |       |
-    |   |   |   | Parcel2                  |                  |     | /parcel                     |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
-    |   |   |   |   | sign_of_change       | integer required |     | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
-    |                                      | enum             |     | 1                           |         |       |        |     |       |
-    |                                      |                  |     | 2                           |         |       |        |     |       |
-    |   |   |   |   | text                 | string           |     | text()                      |         |       |        |     |       |
+ id | d | r | b | m | property                      | type             | ref     | source                      | prepare | level | access | uri | title | description
+    | manifest                                      |                  |         |                             |         |       |        |     |       |
+    |   | resource1                                 | xml              |         |                             |         |       |        |     |       |
+    |                                               |                  |         |                             |         |       |        |     |       |
+    |   |   |   | Parcels                           |                  |         | /parcels                    |         |       |        |     |       | Pasikeitusių žemės sklypų sąrašas
+    |   |   |   |   | parcel1[]                     | backref          | Parcel2 | parcel                      |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcel1[].sign_of_change      | integer required |         | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
+    |                                               | enum             |         | 1                           |         |       |        |     |       |
+    |                                               |                  |         | 2                           |         |       |        |     |       |
+    |                                               |                  |         | 3                           |         |       |        |     |       |
+    |   |   |   |   | parcel1[].text                | string           |         | text()                      |         |       |        |     |       |
+    |   |   |   |   | parcel[]                      | backref          | Parcel1 | parcel                      |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcel[].parcel_unique_number | integer required |         | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
+    |   |   |   |   | parcel[].text                 | string           |         | text()                      |         |       |        |     |       |
+    |   |   |   |   | text                          | string           |         | text()                      |         |       |        |     |       |
+    |                                               |                  |         |                             |         |       |        |     |       |
+    |   |   |   | Parcel1                           |                  |         | /parcels/parcel             |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcel_unique_number          | integer required |         | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
+    |   |   |   |   | parcels                       | ref              | Parcels |                             |         |       |        |     |       |
+    |   |   |   |   | text                          | string           |         | text()                      |         |       |        |     |       |
+    |                                               |                  |         |                             |         |       |        |     |       |
+    |   |   |   | Parcel2                           |                  |         | /parcels/parcel             |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcels                       | ref              | Parcels |                             |         |       |        |     |       |
+    |   |   |   |   | sign_of_change                | integer required |         | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
+    |                                               | enum             |         | 1                           |         |       |        |     |       |
+    |                                               |                  |         | 2                           |         |       |        |     |       |
+    |                                               |                  |         | 3                           |         |       |        |     |       |
+    |   |   |   |   | text                          | string           |         | text()                      |         |       |        |     |       |
 
 """
 
@@ -275,8 +511,19 @@ def test_xsd_choice(rc: RawConfig, tmp_path: Path):
 
 
 def test_xsd_choice_max_occurs_unbounded(rc: RawConfig, tmp_path: Path):
+
     xsd = """
     <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xs:element name="parcels">
+		<xs:annotation>
+			<xs:documentation>Pasikeitusių žemės sklypų sąrašas</xs:documentation>
+		</xs:annotation>
+		<xs:complexType mixed="true">
+			<xs:sequence>
+				<xs:element ref="parcel" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
 	<xs:element name="parcel">
 		<xs:annotation>
 			<xs:documentation>Žemės sklypo pasikeitimo informacija</xs:documentation>
@@ -301,6 +548,7 @@ def test_xsd_choice_max_occurs_unbounded(rc: RawConfig, tmp_path: Path):
 						<xs:restriction base="xs:int">
 							<xs:enumeration value="1"/> <!-- nauji sklypai 	  -->
 							<xs:enumeration value="2"/> <!-- redaguoti sklypai -->
+							<xs:enumeration value="3"/> <!-- anuliuoti sklypai -->
 						</xs:restriction>
 					</xs:simpleType>
 				</xs:element>
@@ -311,16 +559,28 @@ def test_xsd_choice_max_occurs_unbounded(rc: RawConfig, tmp_path: Path):
     """
 
     table = """
- id | d | r | b | m | property             | type    | ref | source                      | prepare | level | access | uri | title | description
-    | manifest                             |         |     |                             |         |       |        |     |       |
-    |   | resource1                        | xml     |     |                             |         |       |        |     |       |
-    |                                      |         |     |                             |         |       |        |     |       |
-    |   |   |   | Parcel                   |         |     | /parcel                     |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
-    |   |   |   |   | parcel_unique_number | integer |     | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
-    |   |   |   |   | sign_of_change       | integer |     | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
-    |                                      | enum    |     | 1                           |         |       |        |     |       |
-    |                                      |         |     | 2                           |         |       |        |     |       |
-    |   |   |   |   | text                 | string  |     | text()                      |         |       |        |     |       |
+ id | d | r | b | m | property                      | type    | ref     | source                      | prepare | level | access | uri | title | description
+    | manifest                                      |         |         |                             |         |       |        |     |       |
+    |   | resource1                                 | xml     |         |                             |         |       |        |     |       |
+    |                                               |         |         |                             |         |       |        |     |       |
+    |   |   |   | Parcels                           |         |         | /parcels                    |         |       |        |     |       | Pasikeitusių žemės sklypų sąrašas
+    |   |   |   |   | parcel[]                      | backref | Parcel  | parcel                      |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcel[].parcel_unique_number | integer |         | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
+    |   |   |   |   | parcel[].sign_of_change       | integer |         | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
+    |                                               | enum    |         | 1                           |         |       |        |     |       |
+    |                                               |         |         | 2                           |         |       |        |     |       |
+    |                                               |         |         | 3                           |         |       |        |     |       |
+    |   |   |   |   | parcel[].text                 | string  |         | text()                      |         |       |        |     |       |
+    |   |   |   |   | text                          | string  |         | text()                      |         |       |        |     |       |
+    |                                               |         |         |                             |         |       |        |     |       |
+    |   |   |   | Parcel                            |         |         | /parcels/parcel             |         |       |        |     |       | Žemės sklypo pasikeitimo informacija
+    |   |   |   |   | parcel_unique_number          | integer |         | parcel_unique_number/text() |         |       |        |     |       | Žemės sklypo unikalus numeris
+    |   |   |   |   | parcels                       | ref     | Parcels |                             |         |       |        |     |       |
+    |   |   |   |   | sign_of_change                | integer |         | sign_of_change/text()       |         |       |        |     |       | Žemės sklypo pasikeitimo požymis
+    |                                               | enum    |         | 1                           |         |       |        |     |       |
+    |                                               |         |         | 2                           |         |       |        |     |       |
+    |                                               |         |         | 3                           |         |       |        |     |       |
+    |   |   |   |   | text                          | string  |         | text()                      |         |       |        |     |       |
 
 """
 
@@ -337,10 +597,23 @@ def test_xsd_attributes(rc: RawConfig, tmp_path: Path):
 
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 
+<xs:element name="SALYGOS">
+  <xs:complexType mixed="true">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="SALYGA" />
+    </xs:choice>
+  </xs:complexType>
+</xs:element>
+
 <xs:element name="SALYGA">
-  <xs:complexType>
+  <xs:complexType mixed="true">
+    <xs:all>
+      <xs:element name="REIKSME"     type="xs:string" />
+      <xs:element name="PAVADINIMAS" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <xs:element name="APRASYMAS"   type="xs:string" minOccurs="0" maxOccurs="1" />
+    </xs:all>
     <xs:attribute name="kodas"    type="xs:string"  use="optional" />
-    <xs:attribute name="pavadinimas"    type="xs:string"  use="optional" />
+    <xs:attribute name="nr"       type="xs:integer" use="optional" />
   </xs:complexType>
 </xs:element>
 
@@ -348,13 +621,29 @@ def test_xsd_attributes(rc: RawConfig, tmp_path: Path):
     """
 
     table = """
- id | d | r | b | m | property             | type            | ref     | source             | prepare | level | access | uri | title | description
-    | manifest                             |                 |         |                    |         |       |        |     |       |
-    |   | resource1                        | xml             |         |                    |         |       |        |     |       |
-    |                                      |                 |         |                    |         |       |        |     |       |
-    |   |   |   | Salyga                   |                 |         | /SALYGA            |         |       |        |     |       |
-    |   |   |   |   | kodas                | string          |         | @kodas             |         |       |        |     |       |
-    |   |   |   |   | pavadinimas          | string          |         | @pavadinimas       |         |       |        |     |       |
+ id | d | r | b | m | property             | type             | ref     | source             | prepare | level | access | uri | title | description
+    | manifest                             |                  |         |                    |         |       |        |     |       |
+    |   | resource1                        | xml              |         |                    |         |       |        |     |       |
+    |                                      |                  |         |                    |         |       |        |     |       |
+    |   |   |   | Salygos                  |                  |         | /SALYGOS           |         |       |        |     |       |
+    |   |   |   |   | salyga[]             | backref          | Salyga  | SALYGA             |         |       |        |     |       |
+    |   |   |   |   | salyga[].aprasymas   | string           |         | APRASYMAS/text()   |         |       |        |     |       |
+    |   |   |   |   | salyga[].kodas       | string           |         | @kodas             |         |       |        |     |       |
+    |   |   |   |   | salyga[].nr          | integer          |         | @nr                |         |       |        |     |       |
+    |   |   |   |   | salyga[].pavadinimas | string           |         | PAVADINIMAS/text() |         |       |        |     |       |
+    |   |   |   |   | salyga[].reiksme     | string required  |         | REIKSME/text()     |         |       |        |     |       |
+    |   |   |   |   | salyga[].text        | string           |         | text()             |         |       |        |     |       |
+    |   |   |   |   | text                 | string           |         | text()             |         |       |        |     |       |
+    |                                      |                  |         |                    |         |       |        |     |       |
+    |   |   |   | Salyga                   |                  |         | /SALYGOS/SALYGA    |         |       |        |     |       |
+    |   |   |   |   | aprasymas            | string           |         | APRASYMAS/text()   |         |       |        |     |       |
+    |   |   |   |   | kodas                | string           |         | @kodas             |         |       |        |     |       |
+    |   |   |   |   | nr                   | integer          |         | @nr                |         |       |        |     |       |
+    |   |   |   |   | pavadinimas          | string           |         | PAVADINIMAS/text() |         |       |        |     |       |
+    |   |   |   |   | reiksme              | string required  |         | REIKSME/text()     |         |       |        |     |       |
+    |   |   |   |   | salygos              | ref              | Salygos |                    |         |       |        |     |       |
+    |   |   |   |   | text                 | string           |         | text()             |         |       |        |     |       |
+
 """
 
     path = tmp_path / 'manifest.xsd'
@@ -366,35 +655,51 @@ def test_xsd_attributes(rc: RawConfig, tmp_path: Path):
 
 
 def test_xsd_model_one_property(rc: RawConfig, tmp_path: Path):
+
     xsd = """
     <xs:schema xmlns="http://eTaarPlat.ServiceContracts/2007/08/Messages" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://eTaarPlat.ServiceContracts/2007/08/Messages">
 
-        <xs:element name="Response">
-            <xs:complexType>
-                <xs:sequence>
-                    <xs:element minOccurs="0" maxOccurs="1" name="searchParameters" type="SearchParametersTRA"/>
-                    <xs:element minOccurs="0" maxOccurs="1" name="klaida">
-                        <xs:complexType>
-                            <xs:sequence>
-                                <xs:element minOccurs="0" name="Aprasymas" type="xs:string" />
-                            </xs:sequence>
-                        </xs:complexType>
-                    </xs:element>  
-                </xs:sequence>
-            </xs:complexType>
-        </xs:element>
+        <xs:complexType name="getTzByTRAResponse">
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="1" name="searchParameters" type="SearchParametersTRA"/>
+                <xs:element minOccurs="0" name="extracttz">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element minOccurs="0" name="extractPreparationTime" type="xs:dateTime" />
+                            <xs:element minOccurs="0" name="phipoteka" type="xs:unsignedByte" />
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element minOccurs="0" maxOccurs="1" name="klaida">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element minOccurs="0" name="Aprasymas" type="xs:string" />
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>  
+            </xs:sequence>
+        </xs:complexType>
         
+        <xs:element name="getTzByTRAResponse" nillable="true" type="getTzByTRAResponse"/>
+
     </xs:schema>
     """
 
     table = """
- id | d | r | b | m | property          | type   | ref | source                  | prepare | level | access | uri | title | description
-    | manifest                          |        |     |                         |         |       |        |     |       |
-    |   | resource1                     | xml    |     |                         |         |       |        |     |       |
-    |                                   |        |     |                         |         |       |        |     |       |
-    |   |   |   | Response              |        |     | /Response               |         |       |        |     |       |
-    |   |   |   |   | aprasymas         | string |     | klaida/Aprasymas/text() |         |       |        |     |       |
-    |   |   |   |   | search_parameters | string |     | searchParameters/text() |         |       |        |     |       |
+ id | d | r | b | m | property                           | type     | ref       | source                                  | prepare | level | access | uri | title | description
+    | manifest                                           |          |           |                                         |         |       |        |     |       |
+    |   | resource1                                      | xml      |           |                                         |         |       |        |     |       |
+    |                                                    |          |           |                                         |         |       |        |     |       |
+    |   |   |   | GetTzByTRAResponse                     |          |           | /getTzByTRAResponse                     |         |       |        |     |       |
+    |   |   |   |   | aprasymas                          | string   |           | klaida/Aprasymas/text()                 |         |       |        |     |       |
+    |   |   |   |   | extracttz                          | ref      | Extracttz | extracttz                               |         |       |        |     |       |
+    |   |   |   |   | extracttz.extract_preparation_time | datetime |           | extracttz/extractPreparationTime/text() |         |       |        |     |       |
+    |   |   |   |   | extracttz.phipoteka                | integer  |           | extracttz/phipoteka/text()              |         |       |        |     |       |
+    |   |   |   |   | search_parameters                  | string   |           | searchParameters/text()                 |         |       |        |     |       |
+    |                                                    |          |           |                                         |         |       |        |     |       |
+    |   |   |   | Extracttz                              |          |           | /getTzByTRAResponse/extracttz           |         |       |        |     |       |
+    |   |   |   |   | extract_preparation_time           | datetime |           | extractPreparationTime/text()           |         |       |        |     |       |
+    |   |   |   |   | phipoteka                          | integer  |           | phipoteka/text()                        |         |       |        |     |       |
 
 """
     path = tmp_path / 'manifest.xsd'
@@ -414,6 +719,7 @@ def test_xsd_separate_simple_type(rc: RawConfig, tmp_path: Path):
       <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_DUOM_SUKURTI" />
       <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_SPI" />
+      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_EMINYS_GAUTAS" />
     </xs:sequence>
   </xs:complexType>
 </xs:element>
@@ -431,6 +737,10 @@ def test_xsd_separate_simple_type(rc: RawConfig, tmp_path: Path):
   </xs:simpleType>
 </xs:element>
 
+<xs:element name="CT_CTD_EMINYS_GAUTAS" type="data_laikas">
+  <xs:annotation><xs:documentation>Ėminio gavimo data</xs:documentation></xs:annotation>
+</xs:element>
+
 <xs:simpleType name="data_laikas">
   <xs:annotation><xs:documentation>Data ir laikas</xs:documentation></xs:annotation>
   <xs:restriction base="xs:string">
@@ -447,6 +757,7 @@ def test_xsd_separate_simple_type(rc: RawConfig, tmp_path: Path):
     |   | resource1                           | xml    |     |                                |         |       |        |     |       |
     |                                         |        |     |                                |         |       |        |     |       |
     |   |   |   | Tyrimas                     |        |     | /TYRIMAS                       |         |       |        |     |       |
+    |   |   |   |   | ct_ctd_eminys_gautas    | string |     | CT_CTD_EMINYS_GAUTAS/text()    |         |       |        |     |       | Ėminio gavimo data
     |   |   |   |   | ct_e200ats_duom_sukurti | string |     | CT_E200ATS_DUOM_SUKURTI/text() |         |       |        |     |       | E200-ats duomenų sukūrimo data ir laikas
     |   |   |   |   | ct_paciento_spi         | string |     | CT_PACIENTO_SPI/text()         |         |       |        |     |       | Paciento prisirašymo įstaigos pavadinimas
 """
@@ -461,40 +772,82 @@ def test_xsd_sequence_choice_sequence(rc: RawConfig, tmp_path: Path):
     # choice in a sequence with a sequence inside
     xsd = """
 <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://rc/ireg/1.0/" targetNamespace="http://rc/ireg/1.0/" elementFormDefault="qualified" attributeFormDefault="unqualified">
-
-    <s:element name="person">
+    <s:element name="data">
         <s:complexType>
             <s:sequence>
-                <s:element minOccurs="0" maxOccurs="1" name="iltu_code" nillable="true" type="s:string" />
-                <s:choice>
-                    <s:sequence>
-                        <s:element minOccurs="0" maxOccurs="1" name="firstName" />
-                        <s:element minOccurs="0" maxOccurs="1" name="lastName" />
-                    </s:sequence>
-                    <s:sequence>
-                        <s:element minOccurs="0" maxOccurs="1" name="businessName" />
-                    </s:sequence>
-                </s:choice>
+                <s:element minOccurs="0" maxOccurs="1" name="responseData" type="tns:summary" />
+                <s:element minOccurs="0" maxOccurs="1" name="responseMessage" type="s:string" />
             </s:sequence>
         </s:complexType>
     </s:element>
+
+    <s:complexType name="summary">
+
+        <s:sequence>
+            <s:element minOccurs="1" maxOccurs="1" name="statementId" />
+            <s:element minOccurs="1" maxOccurs="1" name="title" />
+            <s:element minOccurs="1" maxOccurs="1" name="documents" type="tns:person"></s:element>
+        </s:sequence>
+
+    </s:complexType>
+
+    <s:complexType name="person">
+        <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
+            <s:element minOccurs="0" maxOccurs="1" name="iltu_code" nillable="true" type="s:string" />
+            <s:choice>
+                <s:sequence>
+                    <s:element minOccurs="0" maxOccurs="1" name="firstName" />
+                    <s:element minOccurs="0" maxOccurs="1" name="lastName" />
+                    <s:element minOccurs="0" maxOccurs="1" name="birthDate" />
+                </s:sequence>
+                <s:sequence>
+                    <s:element minOccurs="0" maxOccurs="1" name="businessName" />
+                </s:sequence>
+            </s:choice>
+        </s:sequence>
+    </s:complexType>
 </s:schema>
 """
 
     table = """
- id | d | r | b | m | property      | type   | ref | source              | prepare | level | access | uri | title | description
-    | manifest                      |        |     |                     |         |       |        |     |       |
-    |   | resource1                 | xml    |     |                     |         |       |        |     |       |
-    |                               |        |     |                     |         |       |        |     |       |
-    |   |   |   | Person1           |        |     | /person             |         |       |        |     |       |
-    |   |   |   |   | first_name    | string |     | firstName/text()    |         |       |        |     |       |
-    |   |   |   |   | iltu_code     | string |     | iltu_code/text()    |         |       |        |     |       |
-    |   |   |   |   | last_name     | string |     | lastName/text()     |         |       |        |     |       |
-    |                               |        |     |                     |         |       |        |     |       |
-    |   |   |   | Person2           |        |     | /person             |         |       |        |     |       |
-    |   |   |   |   | business_name | string |     | businessName/text() |         |       |        |     |       |
-    |   |   |   |   | iltu_code     | string |     | iltu_code/text()    |         |       |        |     |       |
-
+ id | d | r | b | m | property                               | type            | ref          | source                                     | prepare | level | access | uri | title | description
+    | manifest                                               |                 |              |                                            |         |       |        |     |       |
+    |   | resource1                                          | xml             |              |                                            |         |       |        |     |       |
+    |                                                        |                 |              |                                            |         |       |        |     |       |
+    |   |   |   | Data                                       |                 |              | /data                                      |         |       |        |     |       |
+    |   |   |   |   | response_data                          | ref             | ResponseData | responseData                               |         |       |        |     |       |
+    |   |   |   |   | response_data.documents                | ref required    | Documents1   | responseData/documents                     |         |       |        |     |       |
+    |   |   |   |   | response_data.documents.birth_date     | string          |              | responseData/documents/birthDate/text()    |         |       |        |     |       |
+    |   |   |   |   | response_data.documents.code           | string          |              | responseData/documents/code/text()         |         |       |        |     |       |
+    |   |   |   |   | response_data.documents.first_name     | string          |              | responseData/documents/firstName/text()    |         |       |        |     |       |
+    |   |   |   |   | response_data.documents.iltu_code      | string          |              | responseData/documents/iltu_code/text()    |         |       |        |     |       |
+    |   |   |   |   | response_data.documents.last_name      | string          |              | responseData/documents/lastName/text()     |         |       |        |     |       |
+    |   |   |   |   | response_data.documents1               | ref required    | Documents2   | responseData/documents                     |         |       |        |     |       |
+    |   |   |   |   | response_data.documents1.business_name | string          |              | responseData/documents/businessName/text() |         |       |        |     |       |
+    |   |   |   |   | response_data.documents1.code          | string          |              | responseData/documents/code/text()         |         |       |        |     |       |
+    |   |   |   |   | response_data.documents1.iltu_code     | string          |              | responseData/documents/iltu_code/text()    |         |       |        |     |       |
+    |   |   |   |   | response_data.statement_id             | string required |              | responseData/statementId/text()            |         |       |        |     |       |
+    |   |   |   |   | response_data.title                    | string required |              | responseData/title/text()                  |         |       |        |     |       |
+    |   |   |   |   | response_message                       | string          |              | responseMessage/text()                     |         |       |        |     |       |
+    |                                                        |                 |              |                                            |         |       |        |     |       |
+    |   |   |   | ResponseData                               |                 |              | /data/responseData                         |         |       |        |     |       |
+    |   |   |   |   | documents                              | ref required    | Documents1   | documents                                  |         |       |        |     |       |
+    |   |   |   |   | documents1                             | ref required    | Documents2   | documents                                  |         |       |        |     |       |
+    |   |   |   |   | statement_id                           | string required |              | statementId/text()                         |         |       |        |     |       |
+    |   |   |   |   | title                                  | string required |              | title/text()                               |         |       |        |     |       |
+    |                                                        |                 |              |                                            |         |       |        |     |       |
+    |   |   |   | Documents1                                 |                 |              | /data/responseData/documents               |         |       |        |     |       |
+    |   |   |   |   | birth_date                             | string          |              | birthDate/text()                           |         |       |        |     |       |
+    |   |   |   |   | code                                   | string          |              | code/text()                                |         |       |        |     |       |
+    |   |   |   |   | first_name                             | string          |              | firstName/text()                           |         |       |        |     |       |
+    |   |   |   |   | iltu_code                              | string          |              | iltu_code/text()                           |         |       |        |     |       |
+    |   |   |   |   | last_name                              | string          |              | lastName/text()                            |         |       |        |     |       |
+    |                                                        |                 |              |                                            |         |       |        |     |       |
+    |   |   |   | Documents2                                 |                 |              | /data/responseData/documents               |         |       |        |     |       |
+    |   |   |   |   | business_name                          | string          |              | businessName/text()                        |         |       |        |     |       |
+    |   |   |   |   | code                                   | string          |              | code/text()                                |         |       |        |     |       |
+    |   |   |   |   | iltu_code                              | string          |              | iltu_code/text()                           |         |       |        |     |       |
 """
     path = tmp_path / 'manifest.xsd'
     with open(path, "w") as xsd_file:
@@ -512,7 +865,17 @@ def test_xsd_complex_ontent(rc: RawConfig, tmp_path: Path):
                 <xs:extension base="BusinessEntityOfBE_FULL">
                     <xs:sequence>
                         <xs:element minOccurs="0" maxOccurs="1" name="title1" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="title2" type="xs:string"/>
                         <xs:element minOccurs="0" maxOccurs="1" name="printeddate" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="searchparameter1" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="searchparameter2" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="searchparameter3" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="statusas" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="DocList" type="ArrayOfBE_FULL_doclist"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="PreorderStatusas" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="PreorderList" type="ArrayOfBE_FULL_preorder"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="ContractStatusas" type="xs:string"/>
+                        <xs:element minOccurs="0" maxOccurs="1" name="ContractList" type="ArrayOfBE_FULL_contract"/>
                     </xs:sequence>
                 </xs:extension>
             </xs:complexContent>
@@ -522,14 +885,23 @@ def test_xsd_complex_ontent(rc: RawConfig, tmp_path: Path):
 """
 
     table = """
- id | d | r | b | m | property    | type   | ref | source             | prepare | level | access | uri | title | description
-    | manifest                    |        |     |                    |         |       |        |     |       |
-    |   | resource1               | xml    |     |                    |         |       |        |     |       |
-    |                             |        |     |                    |         |       |        |     |       |
-    |   |   |   | BeFull          |        |     | /BE_FULL           |         |       |        |     |       |
-    |   |   |   |   | printeddate | string |     | printeddate/text() |         |       |        |     |       |
-    |   |   |   |   | title1      | string |     | title1/text()      |         |       |        |     |       |
-
+ id | d | r | b | m | property          | type   | ref | source                  | prepare | level | access | uri | title | description
+    | manifest                          |        |     |                         |         |       |        |     |       |
+    |   | resource1                     | xml    |     |                         |         |       |        |     |       |
+    |                                   |        |     |                         |         |       |        |     |       |
+    |   |   |   | BeFull                |        |     | /BE_FULL                |         |       |        |     |       |
+    |   |   |   |   | contract_list     | string |     | ContractList/text()     |         |       |        |     |       |
+    |   |   |   |   | contract_statusas | string |     | ContractStatusas/text() |         |       |        |     |       |
+    |   |   |   |   | doc_list          | string |     | DocList/text()          |         |       |        |     |       |
+    |   |   |   |   | preorder_list     | string |     | PreorderList/text()     |         |       |        |     |       |
+    |   |   |   |   | preorder_statusas | string |     | PreorderStatusas/text() |         |       |        |     |       |
+    |   |   |   |   | printeddate       | string |     | printeddate/text()      |         |       |        |     |       |
+    |   |   |   |   | searchparameter1  | string |     | searchparameter1/text() |         |       |        |     |       |
+    |   |   |   |   | searchparameter2  | string |     | searchparameter2/text() |         |       |        |     |       |
+    |   |   |   |   | searchparameter3  | string |     | searchparameter3/text() |         |       |        |     |       |
+    |   |   |   |   | statusas          | string |     | statusas/text()         |         |       |        |     |       |
+    |   |   |   |   | title1            | string |     | title1/text()           |         |       |        |     |       |
+    |   |   |   |   | title2            | string |     | title2/text()           |         |       |        |     |       |
 """
     path = tmp_path / 'manifest.xsd'
     with open(path, "w") as xsd_file:
@@ -588,14 +960,14 @@ def test_xsd_recursion(rc: RawConfig, tmp_path: Path):
     | manifest                               |                 |         |                            |         |       |        |     |       |
     |   | resource1                          | xml             |         |                            |         |       |        |     |       |
     |                                        |                 |         |                            |         |       |        |     |       |
-    |   |   |   | Actions                    |                 |         | /data/responseData/actions |         |       |        |     |       |
-    |   |   |   |   | code[]                 | string required |         | action/code/text()         |         |       |        |     |       | Paslaugos kodas (RC kodas)
-    |   |   |   |   | data                   | ref             | Data    |                            |         |       |        |     |       |
-    |                                        |                 |         |                            |         |       |        |     |       |
     |   |   |   | Data                       |                 |         | /data                      |         |       |        |     |       |
     |   |   |   |   | response_data[]        | backref         | Actions | responseData/actions       |         |       |        |     |       |
     |   |   |   |   | response_data[].code[] | string required |         | action/code/text()         |         |       |        |     |       | Paslaugos kodas (RC kodas)
     |   |   |   |   | response_message       | string          |         | responseMessage/text()     |         |       |        |     |       |
+    |                                        |                 |         |                            |         |       |        |     |       |
+    |   |   |   | Actions                    |                 |         | /data/responseData/actions |         |       |        |     |       |
+    |   |   |   |   | code[]                 | string required |         | action/code/text()         |         |       |        |     |       | Paslaugos kodas (RC kodas)
+    |   |   |   |   | data                   | ref             | Data    |                            |         |       |        |     |       |
 
 """
     path = tmp_path / 'manifest.xsd'
@@ -622,9 +994,43 @@ def test_xsd_enumeration(rc: RawConfig, tmp_path: Path):
             <s:sequence>
                 <s:element name="who_may_consitute" minOccurs="1" maxOccurs="1">
                     <s:simpleType>
+                        <s:annotation>
+                            <s:documentation>Įgaliojimą gali sudaryti.</s:documentation>
+                        </s:annotation>
                         <s:restriction base="s:string">
                             <s:enumeration value="fiz"/>
                             <s:enumeration value="fiz-notarial"/>
+                            <s:enumeration value="jur"/>
+                            <s:enumeration value="jur-notarial"/>
+                            <s:enumeration value="fiz-jur"/>
+                            <s:enumeration value="fiz-notarial-jur-notarial"/>
+                            <s:enumeration value="fiz-notarial-jur"/>
+                            <s:enumeration value="fiz-jur-notarial"/>
+                        </s:restriction>
+                    </s:simpleType>
+                </s:element>
+    
+                <s:element name="default_description_editable" minOccurs="1" maxOccurs="1">
+                    <s:simpleType>
+                        <s:annotation>
+                            <s:documentation>Ar numatytasis aprašymas gali būti redaguojamas? 0 - NE, 1 - TAIP</s:documentation>
+                        </s:annotation>
+                        <s:restriction base="s:string">
+                            <s:enumeration value="0"/>
+                            <s:enumeration value="1"/>
+                        </s:restriction>
+                    </s:simpleType>
+                </s:element>
+    
+                <s:element name="digital_service" minOccurs="1" maxOccurs="1">
+                    <s:simpleType>
+                        <s:annotation>
+                            <s:documentation>El. paslauga. Reikšmės: digital - Tik elektroninė paslauga, analog - Tik neelektroninė paslauga, digital-or-analog - Elektroninė arba neelektroninė paslauga</s:documentation>
+                        </s:annotation>
+                        <s:restriction base="s:string">
+                            <s:enumeration value="digital"/>
+                            <s:enumeration value="analog"/>
+                            <s:enumeration value="digital-or-analog"/>
                         </s:restriction>
                     </s:simpleType>
                 </s:element>
@@ -635,84 +1041,49 @@ def test_xsd_enumeration(rc: RawConfig, tmp_path: Path):
 """
 
     table = """
- id | d | r | b | m | property          | type            | ref | source                                | prepare | level | access | uri | title | description
-    | manifest                          |                 |     |                                       |         |       |        |     |       |
-    |   | resource1                     | xml             |     |                                       |         |       |        |     |       |
-    |                                   |                 |     |                                       |         |       |        |     |       |
-    |   |   |   | Data                  |                 |     | /data                                 |         |       |        |     |       |
-    |   |   |   |   | response_message  | string          |     | responseMessage/text()                |         |       |        |     |       |
-    |   |   |   |   | who_may_consitute | string required |     | responseData/who_may_consitute/text() |         |       |        |     |       |
-
-"""
-    path = tmp_path / 'manifest.xsd'
-    with open(path, "w") as xsd_file:
-        xsd_file.write(xsd)
-    manifest = load_manifest(rc, path)
-    assert manifest == table
+ id | d | r | b | m | property                                   | type            | ref          | source                                           | prepare | level | access | uri | title | description
+    | manifest                                                   |                 |              |                                                  |         |       |        |     |       |
+    |   | resource1                                              | xml             |              |                                                  |         |       |        |     |       |
+    |                                                            |                 |              |                                                  |         |       |        |     |       |
+    |   |   |   | Data                                           |                 |              | /data                                            |         |       |        |     |       |
+    |   |   |   |   | response_data                              | ref             | ResponseData | responseData                                     |         |       |        |     |       |
+    |   |   |   |   | response_data.default_description_editable | string required |              | responseData/default_description_editable/text() |         |       |        |     |       | Ar numatytasis aprašymas gali būti redaguojamas? 0 - NE, 1 - TAIP
+    |                                                            | enum            |              | 0                                                |         |       |        |     |       |
+    |                                                            |                 |              | 1                                                |         |       |        |     |       |
+    |   |   |   |   | response_data.digital_service              | string required |              | responseData/digital_service/text()              |         |       |        |     |       | El. paslauga. Reikšmės: digital - Tik elektroninė paslauga, analog - Tik neelektroninė paslauga, digital-or-analog - Elektroninė arba neelektroninė paslauga
+    |                                                            | enum            |              | digital                                          |         |       |        |     |       |
+    |                                                            |                 |              | analog                                           |         |       |        |     |       |
+    |                                                            |                 |              | digital-or-analog                                |         |       |        |     |       |
+    |   |   |   |   | response_data.who_may_consitute            | string required |              | responseData/who_may_consitute/text()            |         |       |        |     |       | Įgaliojimą gali sudaryti.
+    |                                                            | enum            |              | fiz                                              |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial                                     |         |       |        |     |       |
+    |                                                            |                 |              | jur                                              |         |       |        |     |       |
+    |                                                            |                 |              | jur-notarial                                     |         |       |        |     |       |
+    |                                                            |                 |              | fiz-jur                                          |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial-jur-notarial                        |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial-jur                                 |         |       |        |     |       |
+    |                                                            |                 |              | fiz-jur-notarial                                 |         |       |        |     |       |
+    |   |   |   |   | response_message                           | string          |              | responseMessage/text()                           |         |       |        |     |       |
+    |                                                            |                 |              |                                                  |         |       |        |     |       |
+    |   |   |   | ResponseData                                   |                 |              | /data/responseData                               |         |       |        |     |       |
+    |   |   |   |   | default_description_editable               | string required |              | default_description_editable/text()              |         |       |        |     |       | Ar numatytasis aprašymas gali būti redaguojamas? 0 - NE, 1 - TAIP
+    |                                                            | enum            |              | 0                                                |         |       |        |     |       |
+    |                                                            |                 |              | 1                                                |         |       |        |     |       |
+    |   |   |   |   | digital_service                            | string required |              | digital_service/text()                           |         |       |        |     |       | El. paslauga. Reikšmės: digital - Tik elektroninė paslauga, analog - Tik neelektroninė paslauga, digital-or-analog - Elektroninė arba neelektroninė paslauga
+    |                                                            | enum            |              | digital                                          |         |       |        |     |       |
+    |                                                            |                 |              | analog                                           |         |       |        |     |       |
+    |                                                            |                 |              | digital-or-analog                                |         |       |        |     |       |
+    |   |   |   |   | who_may_consitute                          | string required |              | who_may_consitute/text()                         |         |       |        |     |       | Įgaliojimą gali sudaryti.
+    |                                                            | enum            |              | fiz                                              |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial                                     |         |       |        |     |       |
+    |                                                            |                 |              | jur                                              |         |       |        |     |       |
+    |                                                            |                 |              | jur-notarial                                     |         |       |        |     |       |
+    |                                                            |                 |              | fiz-jur                                          |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial-jur-notarial                        |         |       |        |     |       |
+    |                                                            |                 |              | fiz-notarial-jur                                 |         |       |        |     |       |
+    |                                                            |                 |              | fiz-jur-notarial                                 |         |       |        |     |       |
 
-
-def test_duplicate_removal(rc: RawConfig, tmp_path: Path):
-    xsd = """
-    <xs:schema xmlns="http://eTaarPlat.ServiceContracts/2007/08/Messages" elementFormDefault="qualified" targetNamespace="http://eTaarPlat.ServiceContracts/2007/08/Messages" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-        <xs:element name="getDocumentsByWagonResponse" nillable="true" type="getDocumentsByWagonResponse" />
-        <xs:complexType name="getDocumentsByWagonResponse">
-            <xs:sequence>
-                <xs:element minOccurs="0" maxOccurs="1" name="searchParameters" type="getDocumentsByWagonSearchParams" />
-                <xs:choice minOccurs="1" maxOccurs="1">
-                    <xs:element minOccurs="0" maxOccurs="1" name="klaida" type="Klaida" />
-                    <xs:element minOccurs="0" maxOccurs="1" name="extract" type="Extract" />
-                </xs:choice>
-            </xs:sequence>
-        </xs:complexType>
-        <xs:complexType name="getDocumentsByWagonSearchParams">
-            <xs:sequence>
-                <xs:element minOccurs="0" maxOccurs="1" name="searchType" type="xs:string" />
-                <xs:element minOccurs="0" maxOccurs="1" name="code" type="xs:string" />
-            </xs:sequence>
-        </xs:complexType>
-        <xs:complexType name="Klaida">
-                    <xs:sequence>
-                        <xs:element minOccurs="0" maxOccurs="1" name="Aprasymas" type="xs:string" />
-                    </xs:sequence>
-        </xs:complexType>
-        <xs:complexType name="Extract">
-                    <xs:sequence>
-                        <xs:element minOccurs="1" maxOccurs="1" name="extractPreparationTime" type="xs:dateTime" />
-                        <xs:element minOccurs="1" maxOccurs="1" name="lastUpdateTime" type="xs:dateTime" />
-                    </xs:sequence>
-        </xs:complexType>
-    </xs:schema>
 """
-
-    table = """
- id | d | r | b | m | property                         | type              | ref              | source                                        | prepare | level | access | uri | title | description
-    | manifest                                         |                   |                  |                                               |         |       |        |     |       |
-    |   | resource1                                    | xml               |                  |                                               |         |       |        |     |       |
-    |                                                  |                   |                  |                                               |         |       |        |     |       |
-    |   |   |   | Extract                              |                   |                  | /getDocumentsByWagonResponse/extract          |         |       |        |     |       |
-    |   |   |   |   | extract_preparation_time         | datetime required |                  | extractPreparationTime/text()                 |         |       |        |     |       |
-    |   |   |   |   | last_update_time                 | datetime required |                  | lastUpdateTime/text()                         |         |       |        |     |       |
-    |                                                  |                   |                  |                                               |         |       |        |     |       |
-    |   |   |   | GetDocumentsByWagonResponse1         |                   |                  | /getDocumentsByWagonResponse                  |         |       |        |     |       |
-    |   |   |   |   | aprasymas                        | string            |                  | klaida/Aprasymas/text()                       |         |       |        |     |       |
-    |   |   |   |   | search_parameters                | ref               | SearchParameters | searchParameters                              |         |       |        |     |       |
-    |   |   |   |   | search_parameters.code           | string            |                  | searchParameters/code/text()                  |         |       |        |     |       |
-    |   |   |   |   | search_parameters.search_type    | string            |                  | searchParameters/searchType/text()            |         |       |        |     |       |
-    |                                                  |                   |                  |                                               |         |       |        |     |       |
-    |   |   |   | GetDocumentsByWagonResponse2         |                   |                  | /getDocumentsByWagonResponse                  |         |       |        |     |       |
-    |   |   |   |   | extract                          | ref               | Extract          | extract                                       |         |       |        |     |       |
-    |   |   |   |   | extract.extract_preparation_time | datetime required |                  | extract/extractPreparationTime/text()         |         |       |        |     |       |
-    |   |   |   |   | extract.last_update_time         | datetime required |                  | extract/lastUpdateTime/text()                 |         |       |        |     |       |
-    |   |   |   |   | search_parameters                | ref               | SearchParameters | searchParameters                              |         |       |        |     |       |
-    |   |   |   |   | search_parameters.code           | string            |                  | searchParameters/code/text()                  |         |       |        |     |       |
-    |   |   |   |   | search_parameters.search_type    | string            |                  | searchParameters/searchType/text()            |         |       |        |     |       |
-    |                                                  |                   |                  |                                               |         |       |        |     |       |
-    |   |   |   | SearchParameters                     |                   |                  | /getDocumentsByWagonResponse/searchParameters |         |       |        |     |       |
-    |   |   |   |   | code                             | string            |                  | code/text()                                   |         |       |        |     |       |
-    |   |   |   |   | search_type                      | string            |                  | searchType/text()                             |         |       |        |     |       |
-
-  """
-
     path = tmp_path / 'manifest.xsd'
     with open(path, "w") as xsd_file:
         xsd_file.write(xsd)