yes didnt understand the problem much but i guess split would work
if you know the lengths exactly you can use substring as well
but i do reccomend using the DOM/SAX for interacting with XML rather than writting by yourself