code: private static List<Element> getElements(Document document) {
          List<Element> result = new ArrayList<Element>();
  
          Element root = document.getDocumentElement();
          NodeList nodeList = root.getChildNodes();
          Node node = null;
          Element nodeElement = null;
  
          for (int i = 0; i < nodeList.getLength(); i++) {
              node = nodeList.item(i);
  
              if (node instanceof Element) {
                  nodeElement = (Element) node;
  
                  if (nodeElement.hasAttribute("id") == false) {
                      throw new MjdbcRuntimeException("Found XML element without ID attribute. Parsing is interrupted");
                  } else {
                      result.add(nodeElement);
                  }
              }
          }
  
          return result;
      }
docs: Reads XML document and returns it content as list of queries (as {@link Element})
  
  @param document document which would be read
  @return list of queries (as {@link Element})