foo should not have text (all data is in attributes)
Some elements express their data in enclosed text, for example:
Others express their data in attributes, for example:
This may create confusion.
Check the specification (example) for the correct way to encode this element.
Not clear? Disagree?
You might be able to find help in one of these fine resources.