import java.net.*;
import udir.types.eksamensplan.*;
import javax.xml.bind.*;
import java.io.*;

public class EksamensplanExample {
	
	private static String baseAddress = "https://eksamen-sas.udir.no";

	public static void main(String[] args) throws Exception{		
			
			String uri = baseAddress + "/api/ekstern/eksamensplan";
			URL url = new URL(uri);
			HttpURLConnection connection = (HttpURLConnection) url.openConnection();
			connection.setRequestMethod("GET");
			connection.setRequestProperty("Accept", "application/xml");

			JAXBContext jc = JAXBContext.newInstance(EksamensplanResponse.class);
			InputStream xml = connection.getInputStream();			
			
			EksamensplanResponse eksamensplaner = (EksamensplanResponse) jc.createUnmarshaller().unmarshal(xml);
			
			System.out.println("Fagkoder i eksamensplanen:");
			for(EksamensplanType eksamensplan : eksamensplaner.getEksamensplaner().getEksamensplan())
			{
				for(EksamenType eksamen : eksamensplan.getEksamener().getEksamen())
				{
					System.out.println(eksamen.getFagkode());
				}
			}
			
			connection.disconnect();		
	}
}
@@ -662,394 +662,173 @@
 %0A%09%09%09
-EksamensplanResponse eksamensplaner = (EksamensplanResponse) jc.createUnmarshaller().unmarshal
+BufferedReader in = new BufferedReader(new InputStreamReader
 (xml)
+)
 ;%0A%09%09%09
-%0A%09%09%09System.out.println(%22Fagkoder i eksamensplanen:%22);%0A%09%09%09for(EksamensplanType eksamensplan : eksamensplaner.getEksamensplaner().getEksamensplan())%0A%09%09%09%7B%0A%09%09%09%09for(EksamenType eksamen : eksamensplan.getEksamener().getEksamen())%0A%09%09%09%09%7B%0A%09%09%09%09%09System.out.println(eksamen.getFagkode());%0A%09%09%09%09%7D
+String line = null;%0A%09%09%09while((line = in.readLine()) != null) %7B%0A  %09%09%09%09System.out.println(line);
 %0A%09%09%09

Print out inputstream from eksamensplan