import java.beans.*; import java.io.*; public class TestInput { public static void main(String[] args) throws IOException { String fileName = (args.length == 0) ? "TestInput.xml" : args[0]; XMLDecoder d = new XMLDecoder( new BufferedInputStream( new FileInputStream(fileName))); System.out.println("Read: " + d.readObject()); d.close(); } }