IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
int startTagStartOffset = newNode.getStartOffset();
int offset = endTagStructuredDocumentRegion.getStart();
int length = endTagStructuredDocumentRegion.getLength();
structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save