Sometimes, the <ip> tag does not contain an IP address, but a user's name. Example from dewiki-20100903-stub-meta-history.xml:
<text id="7" />
Supposedly this happens when rev_user is 0, because the user was unknown on the wiki when the revision was created. This is expected behavior and frequently happens when revisions are imported from other wikis. It's especially frequent for very old revisions, imported from usermod.
The expected behavior would be to only show valid IPv4 and IPv6 addresses in the <ip> tag. If the user ID is 0 but the user name is not a valid IP address, it should exported as a regular user but without an ID:
This is especially important for researches who want to be able to distinguish between anonymous contributions and contributions of logged in users. The presence if the <ip> tag is supposed to indicate an anonymous contribution. This bug makes that assumption false and leaves researches only with the possibility to work around the issue by looking for themselves if the <ip> tag actually contains an IP address or not.