An XML export includes the strings 7 and 007. If a field is defined as an integer, both can represent the number seven. If it is a catalog code, the zeros may carry meaning. Use the source contract to decide whether to keep an original string, a typed value, or both.
Reference: W3C XML Schema datatypes. XML Schema describes lexical and value spaces for datatypes.
Separate lexical form
Distinguish the source representation from the interpreted value. XML Schema describes lexical forms separately from the values they represent. A numeric quantity can be parsed and compared numerically, while its original text can be retained when provenance or a contractual display requirement matters. Do not choose the integer type for a code whose leading zeros identify a different record. If exact source bytes are part of the evidence, preserve the original artifact; parsed field text alone need not reproduce all the original markup or encoding.
Validate preservation
Use a fictional XML package with quantity fields containing 7 and 007. Confirm that both approved lexical forms map to the same numeric value when validated and interpreted as the expected integer type. Compare the separately retained source texts and check that they remain distinguishable. Then give the importer a record with 007 as an identifier. Verify that it does not cast the identifier to a number or substitute 7 in the output. Try an invalid quantity and confirm that it is flagged rather than recovered as a plausible code.
Record how the field is used downstream. A quantity and an identifier that look similar can have different equality rules, and the assistant should not invent a shared one to simplify its summary.
Keep synthetic round-trip examples with the declared schema.
Decide which field should appear in quotes or source notes so a formatted number does not get presented as the exact wording of a record.



