/** * Sets the name space on xml stream. * * @param in * the in * @param nameSpace * the name space * @return the source * @throws Exception * the exception */ private static Source setNameSpaceOnXmlStream(final InputStream in, final String nameSpace) throws Exception { final SAXBuilder sb = new SAXBuilder(new XMLReaderSAX2Factory(false)); final Document doc = sb.build(in); doc.getRootElement().setNamespace(Namespace.getNamespace(nameSpace)); return new JDOMSource(doc); }