try {
xsw.writeStartDocument();
xsw.writeStartElement(rootElement);
for (Object o : t)
m.marshal(o, xsw);
xsw.writeEndElement();
xsw.writeEndDocument();
xsw.flush();
} catch (XMLStreamException cause) {
throw ThrowHelper.withInitCause(cause,
new IOException()