title: Exporting Weka DecisionTree from Java API to XML or JSON
body: <p>I have been tasked with enhancing an existing Weka system in Java by adding an export of the decision tree for consumption by offline components (ideally in JSON format, but XML could work too).</p>
  
  <p>Let me warn you that I'm quite new to Weka :)  </p>
  
  <p>I <em>haven’t</em> found a way to get direct access to the J48’s Root Tree (appears to be private w/in the class)—are you aware of a way to get at it? If not, the closest I’ve found as a way to get at the data bit hackish:  use J48.toString() to dump the tree-as-string, and then convert that back into a Tree Structure and then convert that into a JSON string (YUK).</p>
  
  <p>It seems that this use-case is not unusual, so I'm wondering if any of you all have already solved this problem . . . any direction/suggestion is appreciated. </p>
  
  <p>Thanks!</p>