'Recursively searches from the parent to the child,
gathering all the applicable namespaces along the way'

@staticmethod
def _find_namespaces_from_child(parent, child, namespaces):

    for cur_child in parent.childNodes:
        if (cur_child is child):
            return True
        if _MinidomXmlToObject._find_namespaces_from_child(cur_child, child, namespaces):
            for key in cur_child.attributes.keys():
                if (key.startswith('xmlns:') or (key == 'xmlns')):
                    namespaces[key] = cur_child.attributes[key]
            break
    return False
