This is my text file:
5625145214 6
8562320154 2
8542154157 5
6325145214 5
5214214584 6
5625142224 3
8562456754 1
I want to use XStream
to generate XML
file:
This is my code:
private static void generateXml() throws IOException {
XStream xStream = new XStream(new DomDriver());
String line = null;
try (BufferedReader br = new BufferedReader(new FileReader("Unique Numbers.txt"))) {
while ((line = br.readLine()) != null) {
String xml = xStream.toXML(line);
System.out.println(xml);
}
}
}
How can i generate xml
file? I need it.