* Which version of InDesign are you using?
* Which scripting language are you using?
* Do you really mean an XML tag, or do you mean an XML element (the former does not contain data; the latter does)?
* You say you have applied a character style, but you haven't said whether that character style is mapped to an XML tag (which would create an XML element).
* When you say "id value", do you mean the id of the XML element? If so, that's an InDesign scripting property; not something you can find using XPath.