return token;
}
public static Document setupDocument(final String xmlResponse) throws ParserConfigurationException, SAXException, IOException, OpenTokException {
if(null == xmlResponse) {
throw new OpenTokException("There was an error in retrieving the response. Please make sure that you are pointing to the correct server");
}
final DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
Document document;
builder = dbFactory.newDocumentBuilder();
document = builder.parse(new InputSource(new StringReader(xmlResponse)));
final Node errorNodes = TokBoxUtils.parseXML("error", document.getElementsByTagName("error"));
if(null != errorNodes) {
throw new OpenTokException(xmlResponse);
}
return document;
}