Making the for counter static will definitely make the behaviour go wrong if the function is called more than once. If it is the case that there are "compiler warnings that you eliminate by making i static in your for loop" I too would like to see the original warnings.
Separately there are incorrect assumptions about what you can afford to do to i in the loop. For example, in a loop which limits it to i < xml_edit.length() one cannot afford to go:
i++; if (xml_edit[i] != '/')and other similar cases.