}
public Object read(QName name, Node input, Class type) {
if (SAXSource.class.isAssignableFrom(type)) {
try {
CachedOutputStream out = new CachedOutputStream();
DOMUtils.writeXml(input, out);
return new SAXSource(new InputSource(out.getInputStream()));
} catch (IOException e) {
throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
} catch (TransformerException e) {
throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
}
} else if (StreamSource.class.isAssignableFrom(type)) {
try {
CachedOutputStream out = new CachedOutputStream();
DOMUtils.writeXml(input, out);
InputStream is = out.getInputStream();
out.close();
return new StreamSource(is);
} catch (IOException e) {
throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
} catch (TransformerException e) {