public void testWriteTextToWithOMSourcedElement() throws Exception {
OMFactory factory = OMAbstractFactory.getOMFactory();
DataSource ds = new RandomDataSource(665544, 32, 128, 20000000);
QName qname = new QName("a");
OMSourcedElement element = new OMSourcedElementImpl(qname, factory,
new WrappedTextNodeOMDataSourceFromDataSource(qname, ds, Charset.forName("ascii")));
Reader in = new InputStreamReader(ds.getInputStream(), "ascii");
Writer out = new CharacterStreamComparator(in);
ElementHelper.writeTextTo(element, out, true); // cache doesn't matter here
out.close();
}