Easy question about data parsing

To lead this off, I’ll say that I am a PhP/progamming-in-general noob. I have a PhP script that takes XML data sent from a .swf movie and writes it to a .csv file. One of the pieces of data is a string of numbers that usually starts with one of more zeros. The data is saved fine in the actionscript (its treated as a string, so the zeros remain). In the .csv file the leading zeros are never there. The problem either lies in PhP script or the XML data. If the XML is the problem, does anyone know how to create an XML object that keeps leading zeros in a numerical string (i.e. <id>001234</id> )? If the issue lies in the PhP script, does PhP have typing or something similar that will allow it to see a number as a string, so it does not drop leading zeros?