<｜begin▁of▁sentence｜>### Instruction:
Given a bipartite graph with node sets {'A', 'B', 'C', 'D'} and {'1', '2', '3', '4'}, and edges connecting nodes across these sets, provide an example of how to write this graph's edgelist to a file using NetworkX's write_edgelist function.
### Response:
import networkx as nx

# Create a bipartite graph
B = nx.Graph()
# Add nodes with the node attribute "bipartite"
B.add_nodes_from(['A', 'B', 'C', 'D'], bipartite=0)
B.add_nodes_from(['1', '2', '3', '4'], bipartite=1)
# Add edges only between nodes of opposite node sets
B.add_edges_from([('A', '1'), ('B', '2'), ('C', '3'), ('D', '4')])

# Write the bipartite graph to a file
nx.write_edgelist(B, 'bipartite.edgelist', data=False)
<|EOT|>
