code: public static Document stringToXml(String string) throws Exception {
          if (builder == null) {
              throw new Exception("DocumentBuilder is null.");
          }
          return builder.parse(new InputSource(new ByteArrayInputStream(string.getBytes("UTF-8"))));
      }
docs: Convert string to XML {@link Document}
  
  @param string - string to be converted
  @return - {@link Document}
  @throws Exception - if {@link DocumentBuilder} is not initialized