find . -name "*Extent.java" -exec echo "{}," \; -exec grep " CLASSNAME" '{}' > output.xml \;
This is search all the files ends with "Extent.java", print the name, then grep the line which contains "ClASSNAME", then put everything into output.xml
snippet of output.xml
/advising/src/com/dovetailsys/advising/Q5CNPBankRestrictionExtent.java,
public static final String CLASSNAME = "CNPBankRestriction";