public static String toXml(final Config toConvert,Boolean prettyXml) throws JAXBException, IOException {
  String retVal="";
  try (StringWriter writer=new StringWriter()){
    toXml(toConvert,writer,prettyXml);
    retVal=writer.toString();
    return retVal;
  }
 }

public static String toXml ( final Config toConvert , Boolean prettyXml ) throws JAXBException , IOException { String retVal = "" ; try ( StringWriter writer = new StringWriter ( ) ) { toXml ( toConvert , writer , prettyXml ) ; retVal = writer . toString ( ) ; return retVal ; } }
converts config to xml ,
