public static void main(String[] args) throws IOException
    {
        Properties props = new Properties();

        props.setProperty("email", "gmail");

        OutputStream os = new FileOutputStream("D:\\Java SE\\src\\xml\\properties_into_xml\\exmaple.xml");

        props.storeToXML(os, "Email", "UTF-8");

        System.out.println("Done");

        InputStream in = new FileInputStream("D:\\Java SE\\src\\xml\\properties_into_xml\\exmaple.xml");
        props.loadFromXML(in);

        String email = props.getProperty("email");

        System.out.println(email);
    }