149150151152153154155156157158159160
try { FileWriter fw = new FileWriter(target); try { SerializationOptions serializationOptions = new SerializationOptions(); serializationOptions.setCanonical(true); XmlStructUtils.xsToXMLWriter(xs,fw,serializationOptions); } finally { fw.close();