Java tutorial
//package com.java2s; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import java.io.StringReader; public class Main { public static Source getSource(String xml) { return new StreamSource(new StringReader(xml)); } }