// Get hold of a helper context. This holds an XMLHelper instance
HelperContext scope = SDOUtil.createHelperContext();
// Register all of the types we have generated into the HelperContext
GenerateFactory.INSTANCE.register(scope);
// A normal input stream to read the XML file
fis = new FileInputStream("some.xml");
// Use the HelperContext to get and XMLHelper and use this to load the XML
XMLDocument xmlDoc = scope.getXMLHelper().load(fis);
// Now we have a document we can get the root object and cast it to the expected type
GenerateType generateType = (GenerateType)xmlDoc.getRootObject();