def findNode(parent, tag, name=None):
    """ Find a child node with specified tag (and name) """
    try:
        for child in parent.getElementsByTagName(tag):
            if name is None or child.getAttribute('name') == name:
                return child
    except:
        return None
