def dictElement(element, prefix=None, number_multiples=False):
    """Returns a dictionary built from the children of *element*, which must be
    a :class:`xml.etree.ElementTree.Element` instance. Keys of the dictionary
    are *tag* of children without the *prefix*, or namespace. Values depend on
    the content of the child. If a child does not have any children, its text
    attribute is the value. If a child has children, then the child is the
    value.
    """
    dict_ = {}
    length = False
    if isinstance(prefix, str):
        length = len(prefix)
    prev_tag = ''
    for child in element:
        tag = child.tag
        if length and tag.startswith(prefix):
            tag = tag[length:]
        if tag != prev_tag:
            prev_tag = tag
            i = 0
        else:
            i += 1
        if number_multiples:
            tag = tag + '{:>4}'.format(str(i))
        if len(child) == 0:
            if child.text is None:
                dict_[tag] = child.items()
            else:
                dict_[tag] = child.text
        else:
            dict_[tag] = child
    return dict_
