public static String writeOneBlockToXml(Block toSerialize) throws BlocklySerializerException {
  StringWriter sw=new StringWriter();
  List<Block> temp=new ArrayList<>();
  temp.add(toSerialize);
  writeToXml(temp,sw);
  String xmlString=sw.toString();
  try {
    sw.close();
    return xmlString;
  }
 catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}

public static String writeOneBlockToXml ( Block toSerialize ) throws BlocklySerializerException { StringWriter sw = new StringWriter ( ) ; List < Block > temp = new ArrayList < > ( ) ; temp . add ( toSerialize ) ; writeToXml ( temp , sw ) ; String xmlString = sw . toString ( ) ; try { sw . close ( ) ; return xmlString ; } catch ( IOException e ) { throw new IllegalStateException ( e ) ; } }
convenience function to serialize only one block .
