public <T> T unmarshal(XStream xs) {
        return (T) xs.unmarshal(newReader());
    }
@Test
    public void testUnmarshal() throws Exception {
        Foo foo;
        try (InputStream is = XStreamDOMTest.class.getResourceAsStream("XStreamDOMTest.data1.xml")) {
            foo = (Foo) xs.fromXML(is);
        }
        assertEquals("test1", foo.bar.getTagName());
        assertEquals("value", foo.bar.getAttribute("key"));
        assertEquals("text!", foo.bar.getValue());
    }