You really need to know what template format was intended here, so you can use the right templating engine.
This example does happen to match the format of string.Template in the standard library. Whether that actually exactly matches the intended format, or just happens to be close enough for this example, is hard to say. If you don't have anything more complicated than ${identifier} anywhere, it will work.
So:
>>> xml_template = '''<Text>Answer the Question</Text>
<Text>Q${ID}: ${Text}:</Text>'''
>>> ID = '1'
>>> Text = 'Capital of Michigan is'
>>> xml = string.Template(xml_template).substitute(ID=ID, Text=Text)
>>> xml
'<Text>Answer the Question</Text>\n<Text>Q1: Capital of Michigan is:</Text>'
You may also want to use safe_substitute, or to pass **locals() instead of passing explicit arguments, or to actually store your variables in a dict instead of as a bunch of separate variables, etc. Read the docs for further details and examples.
If your pattern format is more complicated, you can customize string.Template (again, see the docs), but you have to understand the complex template dialect you're trying to customize for… and that makes it even more of a good idea to figure out what template engine the patterns were written for and use something compatible.