I want to insert content control(SDT) in document instead of formfield

Hi
I have attached code of inserting Formfield into a document by replacing certain tags can you provide sdt alternative for this.

class ReplaceWithFormFieldsEvaluator implements IReplacingCallback {
DocumentBuilder db;
Object formFieldValue;
String companyDateFormat;
double ContractTitleFontSize;
String ContractTitleFontFace;
String bookmarkName;

public ReplaceWithFormFieldsEvaluator(DocumentBuilder db, Object formFieldValue, String companyDateFormat,
		double ContractTitleFontSize, String ContractTitleFontFace, String bookmarkName) {
	super();
	this.db = db;
	this.formFieldValue = formFieldValue;
	this.companyDateFormat = companyDateFormat;
	this.ContractTitleFontSize = ContractTitleFontSize;
	this.ContractTitleFontFace = ContractTitleFontFace;
	this.bookmarkName = bookmarkName;
}

@Override
public int replacing(ReplacingArgs e) throws Exception {

	// Get name of placeholder.
	String name = e.getMatch().group();

	// If name is empty string, then do nothing.
	if (name == null || name.equals(""))
		return ReplaceAction.SKIP;

	// This is a Run node that contains either the beginning or the complete match.
	Node currentNode = e.getMatchNode();

	// The first (and may be the only) run can contain text before the match, 
	// in this case it is necessary to split the run.
	if (e.getMatchOffset() > 0)
		currentNode = SplitRun((Run) currentNode, e.getMatchOffset());

	// Create DocumentBuilder object, which will help us to insert filds.
	DocumentBuilder builder = new DocumentBuilder((Document) e.getMatchNode().getDocument());

	// Move builder cursor to the current node.
	builder.moveTo(currentNode);

	String value = convertToString(formFieldValue, companyDateFormat);
	if (name.equals("<CONTRACT_TITLE>"))
	{
		builder.getFont().setBold(true);
		builder.getFont().setSize(ContractTitleFontSize);
		builder.getFont().setName(ContractTitleFontFace);
		builder.getCurrentParagraph().getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
		builder.getCurrentParagraph().getListFormat().removeNumbers();
	}
	FormField formField = builder.insertTextInput(bookmarkName, TextFormFieldType.REGULAR, "", value, 0);
	formField.setEnabled(false);
	if (name.equals("<CONTRACT_TITLE>"))
	{
		builder.getFont().setBold(false);
		builder.getFont().clearFormatting();
		builder.insertBreak(BreakType.LINE_BREAK);
	}

	// This array is used to store all nodes of the match for further removing.
	ArrayList<Run> runs = new ArrayList<Run>();

	// Find all runs that contain parts of the match string.
	int remainingLength = e.getMatch().end() - e.getMatch().start();
	while ((remainingLength > 0) && (currentNode != null) && (currentNode.getText().length() <= remainingLength))
	{
		runs.add((Run) currentNode);
		remainingLength = remainingLength - currentNode.getText().length();

		// Select the next Run node. 
		// Have to loop because there could be other nodes such as BookmarkStart etc.
		do
		{
			currentNode = currentNode.getNextSibling();
		}
		while ((currentNode != null) && (currentNode.getNodeType() != NodeType.RUN));
	}

	// Split the last run that contains the match if there is any text left.
	if ((currentNode != null) && (remainingLength > 0))
	{
		SplitRun((Run) currentNode, remainingLength);
		runs.add((Run) currentNode);
	}

	// Now highlight all runs in the sequence.
	for (Run run : runs)
		run.remove();

	// Signal to the replace engine to do nothing because we have already done all what we wanted.
	return ReplaceAction.SKIP;
}

private static Run SplitRun(Run run, int position) throws Exception {
	Run afterRun = (Run) run.deepClone(true);
	afterRun.setText(run.getText().substring(position));
	run.setText(run.getText().substring(0, position));
	run.getParentNode().insertAfter(afterRun, run);
	return afterRun;
}

private String convertToString(Object value, String companyDateFormat) {
	if (value instanceof BigDecimal)
	{
		BigDecimal val = (BigDecimal) value;
		return val.toPlainString();
	}
	else if (value instanceof Integer)
	{
		Integer val = (Integer) value;
		return val.toString();
	}
	else if (value instanceof Date)
	{
		Date val = (Date) value;
		SimpleDateFormat dt = new SimpleDateFormat(companyDateFormat);
		String date = dt.format(val);
		return date;
	}
	else if (value instanceof Boolean)
	{
		Boolean val = (Boolean) value;
		return val.toString();
	}
	else
		return new String("" + value);
}

}

@Karthik_M

Yes, you can replace the text with content control. You need to move the cursor to the matched node and insert the content control. Please read the following article about inserting the content control.
Inserting Content Controls into a Document

Please write your code just before following code snippet.

for (Run run : runs)
  run.remove();