protected static Document convertStringToDocument(String xmlStr) {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder;
    Document doc = null;

    try
    {
      builder = factory.newDocumentBuilder();
      doc = builder.parse( new InputSource( new StringReader( xmlStr ) ) );
    } catch (Exception e) {
      LOG.error("Error during convertation from String \"" + xmlStr + "\" to Xml!", e);
    }
    return doc;
  }
Fetches the maximum value of the given ID column from the given table.

@param tableName
         the name of the table to query the data from
@param idColumnName
         the name of the ID column you want to query the maximum value for.
         This MUST refer an existing numeric type column
@return the maximum value of the given column in the given table if any;
        <code>0L</code> otherwise.
@throws SQLException
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java