def create_DOM_node_from_dict(d, name, parent_node):
    """
    Dumps dict data to an ``xml.etree.ElementTree.SubElement`` DOM subtree
    object and attaches it to the specified DOM parent node. The created
    subtree object is named after the specified name. If the supplied dict is
    ``None`` no DOM node is created for it as well as no DOM subnodes are
    generated  for eventual ``None`` values found inside the dict

    :param d: the input dictionary
    :type d: dict
    :param name: the name for the DOM subtree to be created
    :type name: str
    :param parent_node: the parent DOM node the newly created subtree must be
        attached to
    :type parent_node: ``xml.etree.ElementTree.Element`` or derivative objects
    :returns: ``xml.etree.ElementTree.SubElementTree`` object

    """
    if d is not None:
        root_dict_node = ET.SubElement(parent_node, name)
        for key, value in d.items():
            if value is not None:
                node = ET.SubElement(root_dict_node, key)
                node.text = str(value)
        return root_dict_node
Dumps dict data to an ``xml.etree.ElementTree.SubElement`` DOM subtree
    object and attaches it to the specified DOM parent node. The created
    subtree object is named after the specified name. If the supplied dict is
    ``None`` no DOM node is created for it as well as no DOM subnodes are
    generated  for eventual ``None`` values found inside the dict

    :param d: the input dictionary
    :type d: dict
    :param name: the name for the DOM subtree to be created
    :type name: str
    :param parent_node: the parent DOM node the newly created subtree must be
        attached to
    :type parent_node: ``xml.etree.ElementTree.Element`` or derivative objects
    :returns: ``xml.etree.ElementTree.SubElementTree`` object