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/
code: def __init__(self, model, encoding="utf-8", prettyprint=True):
      if not isinstance(model, BayesianNetwork):
          raise TypeError("model must an instance of BayesianNetwork")
      self.model = model
  
      self.encoding = encoding
      self.prettyprint = prettyprint
  
      self.xml = etree.Element("BIF", attrib={"VERSION": "0.3"})
      self.network = etree.SubElement(self.xml, "NETWORK")
      if self.model.name:
          etree.SubElement(self.network, "NAME").text = self.model.name
      else:
          etree.SubElement(self.network, "NAME").text = "UNTITLED"
  
      self.variables = self.get_variables()
      self.states = self.get_states()
      self.properties = self.get_properties()
      self.definition = self.get_definition()
      self.tables = self.get_values()
  
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 1 to create a new XMLBIFWriter object from inherited base classes: object with example: obj = XMLBIFWriter(model, encoding, prettyprint)