

def xml2json(xml_string, namespaces, pretty_print=False):
    'Convert an xml string to JSON'
    separators = (',', ': ')
    if pretty_print:
        return json.dumps(xml2dict(xml_string, namespaces), indent=4, separators=separators)
    return json.dumps(xml2dict(xml_string, namespaces), separators=separators)

dataset/ETHPy150Open geopython/pycsw/pycsw/core/formats/fmt_json.py xml2json/original