Removing substrings in Java
===

I am trying to remove a searched string from an original string(which is an xml file). For this I used the replaceAll function. However I get empty newlines because I used "" for the string to replace. Is there another way to remove a string?

			start =str.indexOf("<opts>");
			end =str.indexOf("</opts>");
			String removeStr = str.substring(start -6, end + 7);
			str = str.replaceAll(removeStr, "");
The output looks like this:

            <data>
                <param>2</param>
                <unit>1</unit>


            </data>

The original is:

            <data>
                <param>2</param>
                <unit>1</unit>
                <opts>
		            <name>abc</name>
		            <venue>arena0</venue>
                </opts>
                <opts>
		            <name>xyz</name>
		            <venue>arena1</venue>
                </opts>
            </data>