### Question:
XmlBuilder extends ContentBuilderBase<String> implements ContentBuilder<String> { @Override public String buildContent(Collection<Data> elements) throws BagriException { Deque<Data> dataStack = new LinkedList<>(); StringBuilder buff = new StringBuilder(); boolean eltOpen = false; String prefix = ""; for (int i=0; i < ident; i++) { prefix += " "; } for (Data data: elements) { eltOpen = writeElement(dataStack, buff, data, eltOpen, prefix); } boolean writeIdent = false; while (dataStack.size() > 0) { Data top = dataStack.pop(); if (eltOpen) { buff.append("/>"); eltOpen = false; } else { if (writeIdent) { addIdents(top, buff, prefix); } buff.append("</").append(getXmlName(top.getDataPath())).append(">"); } if (pretty) { buff.append(EOL); writeIdent = true; } } return buff.toString(); } XmlBuilder(ModelManagement model); void init(Properties properties); @Override String buildContent(Collection<Data> elements);  }### Answer:
@Test public void testBuildAuctionFromFile() throws Exception { ModelManagement model = new ModelManagementImpl(); XmlStaxParser parser = new XmlStaxParser(model); File file = new File("../etc/samples/xmark/auction.xml"); ParseResults results = parser.parse(file); List<Data> data = results.getResults(); assertNotNull(data); XmlBuilder builder = new XmlBuilder(model); String content = builder.buildContent(data); assertNotNull(content); ParseResults results2 = parser.parse(content); List<Data> data2 = results2.getResults(); assertEquals(data.size(), data2.size()); }