'Returns a list of child nodes that have the tag name and attributes.
@param node {Element} the base node to search from
@param tagname {str} the child tag name to find
@param attributes {dict} the child node must have these attributes
@param startswith {str} the child node name must start with this string
@returns list of matched Element nodes'

def _get_all_children_with_details(self, node, tagname, attributes=None, startswith=None):

    result = []
    for childnode in node.getchildren():
        if (childnode.tag == tagname):
            doesMatch = True
            if attributes:
                for (attrname, attrvalue) in attributes.items():
                    if (childnode.get(attrname) != attrvalue):
                        doesMatch = False
                        break
            if (doesMatch and startswith):
                name = childnode.get('name')
                if ((not name) or (not name.startswith(startswith))):
                    doesMatch = False
            if doesMatch:
                result.append(childnode)
    return result
