code: public void toXml(Object object, OutputStream out, Class<?>... clas) {
  		try {
  			JAXBContext jaxbContext = JAXBContext.newInstance(clas);
  			Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
  			// output pretty printed
  			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
  			jaxbMarshaller.marshal(object, out);
  		} catch (JAXBException e) {
  			throw new JKException(e);
  		}
  	}
docs: To xml.
  
  @param object the object
  @param out    the out
  @param clas   the clas