code: public static Document parse(JsonReader reader) throws IOException, NotImplemented {
          reader.beginArray();
          int nodeType = reader.nextInt();
  
  
          CoreDocumentImpl doc = new DocumentImpl();
  
          if (nodeType == Node.ELEMENT_NODE) {
              addInitialElement(reader, doc);
          } else if (nodeType == Node.DOCUMENT_NODE) {
              addInitialDocNode(doc, reader);
          } else {
              throw new IllegalStateException("Don't know how to handle root node with type " + nodeType);
          }
          reader.endArray();
          return doc;
      }
docs: First element must be a document node or element node
  
  @param reader JSON stream
  @return XML document