def xml2json(xml_string, namespaces, pretty_print=False):

    separators = (',', ': ')

    if pretty_print:
        return json.dumps(xml2dict(xml_string, namespaces),
                          indent=4, separators=separators)

    return json.dumps(xml2dict(xml_string, namespaces), separators=separators)
Serialize the Graph to destination
dataset/ETHPy150Open geopython/pycsw/pycsw/core/formats/fmt_json.py/xml2json--crossover with--dataset/ETHPy150Open RDFLib/rdflib/rdflib/graph.py/Graph.serialize