public void testXmlization() throws Exception {
try {
// create a ConfigurableDataResourceSpecifier
ConfigurableDataResourceSpecifier_impl cspec = new ConfigurableDataResourceSpecifier_impl();
cspec.setUrl("jdbc:db2:MyDatabase");
ResourceMetaData md = new ResourceMetaData_impl();
cspec.setMetaData(md);
md.setName("foo");
ConfigurationParameterDeclarations decls = new ConfigurationParameterDeclarations_impl();
ConfigurationParameter param = new ConfigurationParameter_impl();
param.setName("param");
param.setType("String");
decls.addConfigurationParameter(param);
md.setConfigurationParameterDeclarations(decls);
ConfigurationParameterSettings settings = new ConfigurationParameterSettings_impl();
NameValuePair nvp = new NameValuePair_impl();
nvp.setName("param");
nvp.setValue("bar");
settings.setParameterSettings(new NameValuePair[] { nvp });
md.setConfigurationParameterSettings(settings);
// wrtie to XML
StringWriter sw = new StringWriter();
cspec.toXML(sw);
String xmlStr = sw.getBuffer().toString();