class_docstr: Initializer for XBNWriter class
  
  Parameters
  ----------
  model: BayesianNetwork Instance
      Model to write
  encoding: str(optional)
      Encoding for test data
  prettyprint: Bool(optional)
      Indentation in output XML if true
  
  Reference
  ---------
  http://xml.coverpages.org/xbn-MSdefault19990414.html
  
  Examples
  --------
  >>> writer = XBNWriter(model)
class_docstr_tok: ["Initializer","for","XBNWriter","class","Parameters","--","--","--","--","--","model",":","BayesianNetwork","Instance","Model","to","write","encoding",":","str","(","optional",")","Encoding","for","test","data","prettyprint",":","Bool","(","optional",")","Indentation","in","output","XML","if","true","Reference","--","--","--","--","-","http",":","\/\/xml.coverpages.org\/xbn-MSdefault19990414.html","Examples","--","--","--","--",">",">",">","writer","=","XBNWriter","(","model",")"]
docstr: Return the XML as string.
docstr_tok: ["Return","the","XML","as","string","."]
code: def __str__(self):
      """
      Return the XML as string.
      """
      if self.prettyprint:
          self.indent(self.network)
      return etree.tostring(self.network, encoding=self.encoding)
  
imports: import itertools
  import xml.etree.ElementTree
  import networkx
  import numpy
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 2 for calling the XBNWriter obj's underlying member method code with example usage: obj.__str__() and returns: etree