type.setTypeClass(SimpleBean.class);
type.setTypeMapping(mapping);
type.setSchemaType(new QName("urn:Bean", "bean"));
// Test reading
ElementReader reader = new ElementReader(getResourceAsStream("bean9.xml"));
Context ctx = getContext();
ctx.getGlobalContext().setReadXsiTypes(false);
SimpleBean bean = (SimpleBean)type.readObject(reader, ctx);
assertEquals("bleh", bean.getBleh());
assertEquals("howdy", bean.getHowdy());
reader.getXMLStreamReader().close();
Element element = writeObjectToElement(type, bean, getContext());
assertValid("/b:root/b:bleh[text()='bleh']", element);
assertValid("/b:root/b:howdy[text()='howdy']", element);