class_docstr: Initialise a XMLBIFWriter object.
  
  Parameters
  ----------
  model: BayesianNetwork Instance
      Model to write
  
  encoding: str (optional)
      Encoding for text data
  
  prettyprint: Bool(optional)
      Indentation in output XML if true
  
  Examples
  --------
  >>> from pgmpy.readwrite import XMLBIFWriter
  >>> from pgmpy.utils import get_example_model
  >>> model = get_example_model('asia')
  >>> writer = XMLBIFWriter(model)
  >>> writer.write_xmlbif('asia.xml')
  
  Reference
  ---------
  [1] https://www.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/
docstr: Write the xml data into the file.
  
  Parameters
  ----------
  filename: Name of the file.
  
  Examples
  --------
  >>> from pgmpy.readwrite import XMLBIFWriter
  >>> from pgmpy.utils import get_example_model
  >>> model = get_example_model('asia')
  >>> writer = XMLBIFWriter(model)
  >>> writer.write_xmlbif('asia.xml')
docstr_tok: ["Write","the","xml","data","into","the","file",".","Parameters","--","--","--","--","--","filename",":","Name","of","the","file",".","Examples","--","--","--","--",">",">",">","from","pgmpy.readwrite","import","XMLBIFWriter",">",">",">","from","pgmpy.utils","import","get_example_model",">",">",">","model","=","get_example_model","(","'asia","'",")",">",">",">","writer","=","XMLBIFWriter","(","model",")",">",">",">","writer.write_xmlbif","(","'asia.xml","'",")"]
code: def write_xmlbif(self, filename):
      """
      Write the xml data into the file.
  
      Parameters
      ----------
      filename: Name of the file.
  
      Examples
      --------
      >>> from pgmpy.readwrite import XMLBIFWriter
      >>> from pgmpy.utils import get_example_model
      >>> model = get_example_model('asia')
      >>> writer = XMLBIFWriter(model)
      >>> writer.write_xmlbif('asia.xml')
      """
      with open(filename, "w") as fout:
          fout.write(self.__str__())
  
imports: import xml.etree.ElementTree
  from io import BytesIO
  from itertools import chain
  import numpy
  import pyparsing
  from pgmpy.factors.discrete import State, TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 10 for calling the XMLBIFWriter obj's underlying member method code with example usage: obj.write_xmlbif(filename) without return types