code: public static Element getDocumentElement(Document doc) {
          Element docElement = null;
          if (doc != null) {
              docElement = doc.getDocumentElement();
              if (docElement != null) {
                  // optional, but recommended
                  // see here: http://bit.ly/1h2Ybzb
                  docElement.normalize();
              }
          }
          return docElement;
      }
docs: Return the document {@link Element} of a {@link Document}
  
  @param doc The {@link Document} to obtain the document element from
  @return