@Test
public void configureComplex() throws Exception {

    // build xml
    StringBuilder string0 = new StringBuilder(200)
            .append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
            .append("<configuration>\n")
            .append("   <server>\n")
            .append("     <port>80</port>\n")
            .append("     <host>www.google.com</host>\n")
            .append("   </server>\n")
            .append("   <url>http://www.google.com/</url>\n")
            .append("</configuration>")
            .append("");
    // parse xml
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
    XmlParser parser = new XmlParser();
    XmlParser.Node rootNode = parser.parse(is);
    // object we'll configure
    ComplexConfiguration config = new ComplexConfiguration();
    Assert.assertNull(config.getServer());
    Assert.assertNull(config.url);
    // configure it using default options
    XmlBean bean = new XmlBean();
    bean.configure(rootNode, config);
    // confirm properties
    Assert.assertNotNull(config.getServer());
    Assert.assertEquals("http://www.google.com/", config.url);
    Assert.assertEquals(80, config.getServer().port);
    Assert.assertEquals("www.google.com", config.getServer().host);
}