You can use javax.xml.parsers.DocumentBuilder to parse the XML document. You may be doing that already. There are several parse() methods. One takes a java.io.InputStream. You can use java.io.StringBufferInputStream (a subclass of InputStream) to create an InputStream from a String. It's deprecated but it'll work. Alternatively, you can use the DocumentBuilder.parse that takes an org.xml.sax.InputSource object to get its input. You can ...