<｜begin▁of▁sentence｜>### Instruction:
Given the Condensed Matter Collaborations 2005 graph which you can read from a GML file named cond-mat-2005.gml, can you use the Leiden algorithm in cdlib to perform community detection? And can you convert the NodeClustering object to a JSON representation?
### Response:
import networkx as nx
from cdlib import algorithms

# Reading the condensed matter collaborations 2005 graph
G = nx.read_gml('cond-mat-2005.gml')

# Applying Leiden algorithm for community detection
communities = algorithms.leiden(G)

# Convert the NodeClustering object to JSON
clusters_json = communities.to_json()

print(clusters_json)
<|EOT|>
