Search and replace xml text

ok - so I am loading XML and then trying to search and replace some of the text: see below for code (this is after all the xml load stuff…). It is not effecting the xml after loading??? please help.

function loadTxt(success:Boolean):Void {
if (success) {

var allXML:XMLNode = txt.firstChild;

txtCSS = new TextField.StyleSheet();

cssURL = “css/style.css”;
txtCSS.load(cssURL);

txtCSS.onLoad = function(success) {
if (success) {
scroller.txt.t.styleSheet = txtCSS; scroller.txt.t.autoSize = “left”;
scroller.txt.t.html = true;
scroller.txt.t.htmlText = allXML.childNodes[0].firstChild.nodeValue;
}
};
searchAndReplace(scroller.txt.t.htmlText, “1”, “2”);
} else {
trace(“XML NOT LOADED”);
}
}

function searchAndReplace(holder, searchfor, replacement) {
temparray = holder.split(searchfor);
holder = temparray.join(replacement);
return (holder);
}