code: public Document parseXml(String xml) throws NexmoResponseParseException {
          // TODO: Maybe an Error subclass for XML initialization errors, as these are serious and unexpected.
          Document doc;
          this.documentBuilderLock.lock();
          try {
              if (this.documentBuilder == null) {
                  DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
                  this.documentBuilder = documentBuilderFactory.newDocumentBuilder();
              }
              doc = XmlUtil.parseXmlString(this.documentBuilder, xml);
          } catch (ParserConfigurationException e) {
              throw new NexmoResponseParseException("Exception initialing XML parser", e);
          } finally {
              this.documentBuilderLock.unlock();
          }
          return doc;
      }
docs: Parse a provided XML String and return the generated DOM Document.
  
  @param xml A String containing XML.
  @return A Document generated from the parsed XML.
  @throws NexmoResponseParseException If there is a problem initializing the XML parser or parsing the XML.