*/
public class Node2XObject extends BaseTransformer<Node, XObject> implements PullTransformer<Node, XObject> {
public XObject transform(Node source, TransformationContext context) {
try {
DomReader in = null;
if (source instanceof Document) {
in = new DomReader((Document)source);
} else if (source instanceof Element) {
in = new DomReader((Element)source);
}
XStream xs = new XStream();
return (XObject)xs.unmarshal(in);
} catch (Exception e) {
throw new TransformationException(e);