def tocimxml(self):
        """
        Return the CIM-XML representation of this CIM property,
        as an object of an appropriate subclass of :term:`Element`.

        The returned CIM-XML representation is a `PROPERTY`,
        `PROPERTY.REFERENCE`, or `PROPERTY.ARRAY` element dependent on the
        property type, and consistent with :term:`DSP0201`. Note that
        array properties cannot be of reference type.

        The order of qualifiers in the returned CIM-XML representation is
        preserved from the :class:`~pywbem.CIMProperty` object.

        Returns:

          The CIM-XML representation, as an object of an appropriate subclass
          of :term:`Element`.
        """

        qualifiers = [q.tocimxml() for q in self.qualifiers.values()]

        if self.is_array:  # pylint: disable=no-else-return
            assert self.type != 'reference'

            if self.value is None:
                value_xml = None
            else:
                array_xml = []
                for v in self.value:
                    if v is None:
                        if SEND_VALUE_NULL:
                            array_xml.append(cim_xml.VALUE_NULL())
                        else:
                            array_xml.append(cim_xml.VALUE(None))
                    elif self.embedded_object is not None:
                        assert isinstance(v, (CIMInstance, CIMClass))
                        array_xml.append(cim_xml.VALUE(v.tocimxml().toxml()))
                    else:
                        array_xml.append(cim_xml.VALUE(atomic_to_cim_xml(v)))
                value_xml = cim_xml.VALUE_ARRAY(array_xml)

            return cim_xml.PROPERTY_ARRAY(
                self.name,
                self.type,
                value_xml,
                self.array_size,
                self.class_origin,
                self.propagated,
                embedded_object=self.embedded_object,
                qualifiers=qualifiers)

        elif self.type == 'reference':  # scalar

            if self.value is None:
                value_xml = None
            else:
                value_xml = cim_xml.VALUE_REFERENCE(self.value.tocimxml())

            return cim_xml.PROPERTY_REFERENCE(
                self.name,
                value_xml,
                reference_class=self.reference_class,
                class_origin=self.class_origin,
                propagated=self.propagated,
                qualifiers=qualifiers)

        else:  # scalar non-reference

            if self.value is None:
                value_xml = None
            else:
                if self.embedded_object is not None:
                    assert isinstance(self.value, (CIMInstance, CIMClass))
                    value_xml = cim_xml.VALUE(self.value.tocimxml().toxml())
                else:
                    value_xml = cim_xml.VALUE(atomic_to_cim_xml(self.value))

            return cim_xml.PROPERTY(
                self.name,
                self.type,
                value_xml,
                class_origin=self.class_origin,
                propagated=self.propagated,
                embedded_object=self.embedded_object,
                qualifiers=qualifiers)
Return the CIM-XML representation of this CIM property,
        as an object of an appropriate subclass of :term:`Element`.

        The returned CIM-XML representation is a `PROPERTY`,
        `PROPERTY.REFERENCE`, or `PROPERTY.ARRAY` element dependent on the
        property type, and consistent with :term:`DSP0201`. Note that
        array properties cannot be of reference type.

        The order of qualifiers in the returned CIM-XML representation is
        preserved from the :class:`~pywbem.CIMProperty` object.

        Returns:

          The CIM-XML representation, as an object of an appropriate subclass
          of :term:`Element`.