'Get the information about a repository to create and populate an XML tag set.  The
generated attributes will be contained within the <repository> tag, while the sub_elements
will be tag sets contained within the <repository> tag set.'

def get_repository_attributes_and_sub_elements(self, repository, archive_name):

    attributes = odict()
    sub_elements = odict()
    attributes['name'] = str(repository.name)
    attributes['type'] = str(repository.type)
    attributes['username'] = str(repository.user.username)
    sub_elements['description'] = repository.description
    sub_elements['long_description'] = repository.long_description
    sub_elements['archive'] = archive_name
    categories = []
    for rca in repository.categories:
        category = rca.category
        categories.append(('category', str(category.name)))
    sub_elements['categories'] = categories
    return (attributes, sub_elements)
