Thanks for the help all.
I will give your example a try Mr. Hatter!
And to further clarify I am passing a css file (in string format) in shift.
I need to write a script that grabs a css file and formats it into xml.
I'm grateful for the help and will be posting results shortly - thanks again!