XercesXsMarshaller marshaller = new XercesXsMarshaller();
marshaller.setSchemaResolver(SCHEMA_RESOLVER);
marshaller.mapClassToXsiType(UKAddress.class, PO_NS, "UKAddress");
marshaller.mapClassToXsiType(USAddress.class, PO_NS, "USAddress");
MappingObjectModelProvider provider = new MappingObjectModelProvider();
StringWriter writer = new StringWriter();
marshaller.marshal(new StringReader(PO_XSD), provider, PurchaseOrder.INSTANCE, writer);
assertXmlEqual(PO_XML, writer.getBuffer().toString());
}