def makeServiceDocXML(title, collections):
    """
    Make an ATOM service doc here. The 'collections' parameter is a list of
    dictionaries, with the keys of 'title', 'accept' and 'categories'
    being valid
    """

    serviceTag = etree.Element("service")
    workspaceTag = etree.SubElement(serviceTag, "workspace")
    titleTag = etree.SubElement(workspaceTag, ATOM + "title", nsmap=ATOM_NSMAP)
    titleTag.text = title
    for collection in collections:
        collectionTag = etree.SubElement(workspaceTag, "collection")
        if 'href' in collection:
            collectionTag.set("href", collection['href'])
        if 'title' in collection:
            colTitleTag = etree.SubElement(
                collectionTag, ATOM + "title", nsmap=ATOM_NSMAP
            )
            colTitleTag.text = collection['title']
        if 'accept' in collection:
            acceptTag = etree.SubElement(collectionTag, "accept")
            acceptTag.text = collection['accept']
    return serviceTag
def makeServiceDocXML ( title , collections ) : serviceTag = etree . Element ( "service" ) workspaceTag = etree . SubElement ( serviceTag , "workspace" ) titleTag = etree . SubElement ( workspaceTag , ATOM + "title" , nsmap = ATOM_NSMAP ) titleTag . text = title for collection in collections : collectionTag = etree . SubElement ( workspaceTag , "collection" ) if 'href' in collection : collectionTag . set ( "href" , collection [ 'href' ] ) if 'title' in collection : colTitleTag = etree . SubElement ( collectionTag , ATOM + "title" , nsmap = ATOM_NSMAP ) colTitleTag . text = collection [ 'title' ] if 'accept' in collection : acceptTag = etree . SubElement ( collectionTag , "accept" ) acceptTag . text = collection [ 'accept' ] return serviceTag
Make an ATOM service doc here. The 'collections' parameter is a list of
    dictionaries, with the keys of 'title', 'accept' and 'categories'
    being valid