What you have asked is just writing and reading into a file as standalone java class. but it you go for a project like spring-mvc i cannot write or update the value.
I used File sequenceStorageFile = ResourceUtils.getFile("classpath:sequenceValue/sequence.xml");
to read data from this xml file. But I don't know how to write into the same file to update the value.
Can someone tell me how to write into the same xml file?