code: public static Document getResultSetAsXML(ResultSet rs, String tableName) throws Exception {
          return getResultSetAsXML(rs, tableName, "");
      }
docs: Return an XML document containing the specified ResultSet.
  
  @param rs The specified ResultSet
  @return the XML document
  @throws java.lang.Exception