'Selects resources from an element tree
@param tree: the element tree
@param tablename: table name to search for'

@classmethod
def select_resources(cls, tree, tablename):

    resources = []
    if isinstance(tree, etree._ElementTree):
        root = tree.getroot()
        if ((root is None) or (root.tag != cls.TAG.root)):
            return resources
    else:
        root = tree
    if ((root is None) or (not len(root))):
        return resources
    expr = ('./%s[@%s="%s"]' % (cls.TAG.resource, cls.ATTRIBUTE.name, tablename))
    resources = root.xpath(expr)
    return resources
