import org.apache.axiom.om.impl.builder.test.xmlbeans.OrderDocument.Order.Item;
import org.custommonkey.xmlunit.XMLTestCase;
public class SAXOMBuilderXMLBeansTest extends XMLTestCase {
public void test() throws Exception {
OrderDocument document = OrderDocument.Factory.newInstance();
Order order = document.addNewOrder();
order.setCustomerId("73107481");
Item item = order.addNewItem();
item.setPartId("P85-137-19");
item.setQuantity(2);
item = order.addNewItem();
item.setPartId("O85-554-66");
item.setQuantity(1);
StringWriter out = new StringWriter();
document.save(out);
SAXOMBuilder builder = new SAXOMBuilder();
document.save(builder, builder);
assertXMLIdentical(compareXML(out.toString(), builder.getRootElement().toString()), true);
}