code: public void toXml(final Writer wtr) throws ConfigException {
      try {
        XmlEmit xml = new XmlEmit();
        xml.addNs(new NameSpace(ns, "BW"), true);
        xml.startEmit(wtr);
  
        dump(xml, false);
        xml.flush();
      } catch (ConfigException cfe) {
        throw cfe;
      } catch (Throwable t) {
        throw new ConfigException(t);
      }
    }
docs: Output to a writer
  
  @param wtr
  @throws ConfigException