def XmlAttr(xnNode,sAttrName,bRequired):
	"""Read XML attribute value.
	[xnNode]: XML node, containing attribute value.
	[sAttrName]: string, name of attribute to read.
	[bRequired]: bool, attribute is required; Exception if attribute missing. 
	<retval>: string, attribute value.
	<except>: Exception, if attribute required and missing.
	"""
	sAttrVal=xnNode.get(sAttrName);
	if(sAttrVal==None):
		if(bRequired): raise Exception("Required attribute '"+sAttrName+"' missing");
	else: sAttrVal=sAttrVal.strip()
	return sAttrVal