*/
public void outputTo(XMLStreamWriter writer) throws XMLStreamException {
// Using OM to convert the reader to a writer. This seems to be
// the safest way to make the conversion, and it promotes code re-use.
StAXOMBuilder builder = new StAXOMBuilder(reader);
OMDocument omDocument = builder.getDocument();
Iterator it = omDocument.getChildren();
while (it.hasNext()) {
OMNode omNode = (OMNode)it.next();
// TODO Using serialize and consume
// caused an axiom bug...falling back to serialize
// (which is less performant due to om caching)