For example: I am using HMAC SHA 256 to sign an XML file. Part of the file data is a version number. If I append the version to my secret to use it as a key, does that weaken the HMAC? As the version is also part of the signed message is it weakend or still safe?
If I understand you correctly, you're using a known (i.e. visible to an attacker) piece of information as part of your key. If this is the case, then you are absolutely weaking your HMAC, because you're reducing the amount of unknown keyspace they need to bruteforce to forge a message.
For example, if you're using a 128-bit key with your HMAC, but 32 of those bits are always known to an attacker, then they only need to attack a 96-bit keyspace.