#fixed code
                                public static void saveAsXML(NSObject root, File out) throws IOException {
	OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(out), "UTF-8");
        w.write(root.toXMLPropertyList());
        w.close();
    }
#vulnerable code 
                                public static void saveAsXML(NSObject root, File out) throws IOException {
        FileWriter fw = new FileWriter(out);
        fw.write(root.toXMLPropertyList());
        fw.close();
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK