System.out.println(outputWriter.toString()); }}
public void test() {	 StringWriter outputWriter = new StringWriter();           // Betwixt just writes out the bean as a fragment     // So if we want well-formed xml, we need to add the prolog     outputWriter.write("<?xml version='1.0' ?>");          // Create a BeanWriter which writes to our prepared stream     BeanWriter beanWriter = new BeanWriter(outputWriter);          // Configure betwixt     // For more details see java docs or later in the main documentation     beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(false);     beanWriter.getBindingConfiguration().setMapIDs(false);     beanWriter.enablePrettyPrint();          // Write example bean as base element 'person'     try {		beanWriter.write("database", new DataSourceConfig("alias","driver","password", "userid", "url"));	} catch (IOException e) {		e.printStackTrace();	} catch (SAXException e) {		e.printStackTrace();	} catch (IntrospectionException e) {		e.printStackTrace();	}          // Write to System.out     // (We could have used the empty constructor for BeanWriter     // but this way is more instructive)     System.out.println(outputWriter.toString());}}