# This code has been automatically generated by:
# dev_scripts/test_codegen/generate_test_for_xmlization_of_classes_with_descendants.py
# Do NOT edit or append.


"""Test XML de/serialization of classes with descendants."""


# pylint: disable=missing-docstring


import io
import pathlib
import tempfile
import unittest
import xml.etree.ElementTree as ET

import aas_core3.xmlization as aas_xmlization

import tests.common
import tests.common_jsonization
import tests.common_xmlization


class Test_HasSemantics(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.HasSemantics`.
    """

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_extension(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_extension()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_qualifier(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_qualifier()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_specific_asset_id(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_specific_asset_id()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_semantics_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_semantics_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_semantics_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_semantics_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_HasExtensions(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.HasExtensions`.
    """

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_extensions_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_extensions_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_extensions_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_extensions_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_Referable(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.Referable`.
    """

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.referable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.referable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.referable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.referable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_Identifiable(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.Identifiable`.
    """

    def test_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.identifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.identifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.identifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.identifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.identifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.identifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.identifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.identifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.identifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.identifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.identifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.identifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_HasKind(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.HasKind`.
    """

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_kind_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_kind_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_kind_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_kind_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_HasDataSpecification(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.HasDataSpecification`.
    """

    def test_over_administrative_information(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_administrative_information()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.has_data_specification_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.has_data_specification_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.has_data_specification_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.has_data_specification_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_Qualifiable(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.Qualifiable`.
    """

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.qualifiable_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.qualifiable_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.qualifiable_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.qualifiable_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_SubmodelElement(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.SubmodelElement`.
    """

    def test_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.submodel_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.submodel_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.submodel_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.submodel_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_RelationshipElement(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.RelationshipElement`.
    """

    def test_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.relationship_element_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.relationship_element_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.relationship_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.relationship_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_DataElement(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.DataElement`.
    """

    def test_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_EventElement(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.EventElement`.
    """

    def test_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.event_element_from_iterparse(iterator)

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.event_element_from_stream(io.StringIO(text))
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.event_element_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.event_element_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_AbstractLangString(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.AbstractLangString`.
    """

    def test_over_lang_string_definition_type_iec_61360(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_lang_string_definition_type_iec_61360()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.abstract_lang_string_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.abstract_lang_string_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.abstract_lang_string_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.abstract_lang_string_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_lang_string_name_type(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_lang_string_name_type()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.abstract_lang_string_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.abstract_lang_string_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.abstract_lang_string_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.abstract_lang_string_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_lang_string_preferred_name_type_iec_61360(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_lang_string_preferred_name_type_iec_61360()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.abstract_lang_string_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.abstract_lang_string_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.abstract_lang_string_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.abstract_lang_string_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_lang_string_short_name_type_iec_61360(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_lang_string_short_name_type_iec_61360()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.abstract_lang_string_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.abstract_lang_string_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.abstract_lang_string_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.abstract_lang_string_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion

    def test_over_lang_string_text_type(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_lang_string_text_type()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.abstract_lang_string_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.abstract_lang_string_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.abstract_lang_string_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.abstract_lang_string_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


class Test_DataSpecificationContent(unittest.TestCase):
    """
    Test round-trip XML de/serialization over concrete descendants
    of :py:class:`aas_types.DataSpecificationContent`.
    """

    def test_over_data_specification_iec_61360(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_data_specification_iec_61360()
        )
        text = aas_xmlization.to_str(concrete_instance)
        et_concrete = ET.fromstring(text)

        # region From iterparse
        iterator = ET.iterparse(source=io.StringIO(text), events=["start", "end"])
        got_from_iterparse = aas_xmlization.data_specification_content_from_iterparse(
            iterator
        )

        et_from_iterparse = ET.fromstring(aas_xmlization.to_str(got_from_iterparse))
        tests.common_xmlization.remove_redundant_whitespace(et_from_iterparse)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_iterparse)
        # endregion

        # region From stream
        got_from_stream = aas_xmlization.data_specification_content_from_stream(
            io.StringIO(text)
        )
        et_from_stream = ET.fromstring(aas_xmlization.to_str(got_from_stream))
        tests.common_xmlization.remove_redundant_whitespace(et_from_stream)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_stream)
        # endregion

        # region From file
        with tempfile.TemporaryDirectory() as tmp_dir:
            path = pathlib.Path(tmp_dir) / "something.xml"
            path.write_text(text, encoding="utf-8")

            got_from_file = aas_xmlization.data_specification_content_from_file(path)
        et_from_file = ET.fromstring(aas_xmlization.to_str(got_from_file))
        tests.common_xmlization.remove_redundant_whitespace(et_from_file)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_file)
        # endregion

        # region From string
        got_from_str = aas_xmlization.data_specification_content_from_str(text)
        et_from_str = ET.fromstring(aas_xmlization.to_str(got_from_str))
        tests.common_xmlization.remove_redundant_whitespace(et_from_str)
        tests.common_xmlization.assert_elements_equal(et_concrete, et_from_str)
        # endregion


if __name__ == "__main__":
    unittest.main()


# This code has been automatically generated by:
# dev_scripts/test_codegen/generate_test_for_xmlization_of_classes_with_descendants.py
# Do NOT edit or append.
