// this hurts my soul
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);
	}
attr.setValue(content.toString());
}
save.addAttr(attr); // this hurts my soul
}
m.marshal(save, fos);
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); // this hurts my soul
}
m.marshal(save, fos);
}