Well, I've just tried it with the data as you've posted it in this older thread, and it worked. I've replaced some of the quantities by 0, ran my script, and it replaced those by:
<Line>
<Quantity>0</Quantity>
</Line>
So you say it did not work. But it seems to work fine for me. Did you get any errors? Did you use a different type of data?
Please note that it's important that you take the time to properly describe the problems you're having. Saying something worked or didn't work is of no use if you do not provide details of what you've tried, errors you get if any, and the result that you've got. The more you tell us, the better we can help you.
Regards,
Raphaël Lalonde Lefebvre