CharArrayDataSource cads = new CharArrayDataSource(payload1.toCharArray());
OMElement parent = factory.createOMElement("root", null);
OMSourcedElement omse = factory.createOMElement(cads, localName, ns);
parent.addChild(omse);
OMNode firstChild = parent.getFirstOMChild();
assertTrue("Expected OMSourcedElement child", firstChild instanceof OMSourcedElement);
OMSourcedElement child = (OMSourcedElement) firstChild;
assertTrue("OMSourcedElement is expanded. This is unexpected", !child.isExpanded());
assertTrue("OMSourcedElement should be backed by a ByteArrayDataSource",
child.getDataSource() instanceof CharArrayDataSource);