private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException
	{
		JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class);
		Marshaller m = ctx.createMarshaller();
		m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
		m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING);
		com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context();
		save.setFactory(ref.getFactoryClassName());
		save.setClazz(ref.getClassName());
		Enumeration<RefAddr> all = ref.getAll();
		while (all.hasMoreElements())
		{
			RefAddr refAddr = all.nextElement();
			Attr attr = new Attr();
			attr.setName(refAddr.getType());
			Object content = refAddr.getContent();
			if (content != null)
			{
				attr.setValue(content.toString());
			}
			save.addAttr(attr); // this hurts my soul
		}
		m.marshal(save, fos);
	}
private void saveXML(Reference ref, FileOutputStream fos) throws JAXBException
	{
		JAXBContext ctx = JAXBContext.newInstance(com.digi_dmx.gen.Context.class);
		Marshaller m = ctx.createMarshaller();
		m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
		m.setProperty(Marshaller.JAXB_ENCODING, DEFAULT_ENCODING);
		com.digi_dmx.gen.Context save = new com.digi_dmx.gen.Context();
		save.setFactory(ref.getFactoryClassName());
		save.setClazz(ref.getClassName());
		Enumeration<RefAddr> all = ref.getAll();
		while (all.hasMoreElements())
		{
			RefAddr refAddr = all.nextElement();
			Attr attr = new Attr();
			attr.setName(refAddr.getType());
			Object content = refAddr.getContent();
			if (content != null)
			{
				attr.setValue(content.toString());
			}
			save.addAttr(attr);
		}
		m.marshal(save, fos);
	}
private void savexml(reference ref, fileoutputstream fos) throws jaxbexception { jaxbcontext ctx = jaxbcontext.newinstance(com.digi_dmx.gen.context.class); marshaller m = ctx.createmarshaller(); m.setproperty(marshaller.jaxb_formatted_output, true); m.setproperty(marshaller.jaxb_encoding, default_encoding); com.digi_dmx.gen.context save = new com.digi_dmx.gen.context(); save.setfactory(ref.getfactoryclassname()); save.setclazz(ref.getclassname()); enumeration<refaddr> all = ref.getall(); while (all.hasmoreelements()) { refaddr refaddr = all.nextelement(); attr attr = new attr(); attr.setname(refaddr.gettype()); object content = refaddr.getcontent(); if (content != null) { attr.setvalue(content.tostring()); } save.addattr(attr); } m.marshal(save, fos); }