That could work, but I would prefer to have a more robust file reading engine that would handle corrupted files. This system would get messed up if one of the pictures or anything in the file gets corrupt. What is the best way to make a reliable file reading algorithm?

Quote Originally Posted by Ken B
I'm creating pdf files, not xml. So this may not work.

How about adding the image size before writing the image to the file. This way, you would know how many bytes to read to get the image.

Code:
<item>
    <question>Who was the first President of the US?</question>
    <answer>George Washington</answer>
    <size>74589</size>
    <picture>PIC BINARY GOES HERE</picture>
</item>