NodeList nl = ((Document) src.getNode()).getDocumentElement().getElementsByTagName("long"); assertEquals(1, nl.getLength()); Text txt = (Text) nl.item(0).getFirstChild(); System.out.println(txt.getTextContent());  StringBuffer expected = new StringBuffer(); for (int i = 0; i < 4; i++) { for (int j = 0; j < 10; j++) { for (int k = 0; k < 10; k++) { expected.append((char)('0' + j)); expected.append((char)('0' + k)); if (k != 9) { expected.append(' '); } } expected.append("\n"); } }  assertEquals(expected.toString(), txt.getTextContent());
    public void testStaxToDOM() throws Exception {        InputStream is = getClass().getResourceAsStream("test.xml");        XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(is);        StaxSource ss = new StaxSource(xsr);        DOMSource src = new SourceTransformer().toDOMSource(ss);        assertNotNull(src);        assertNotNull(src.getNode());    }