internal SecurityElement ToXml()
{
SecurityElement root = new SecurityElement("Identity");
if (Authenticated)
{
root.AddAttribute("Authenticated", "true");
}
if (ID != null)
{
root.AddAttribute("ID", SecurityElement.Escape(ID));
}
if (Role != null)
{
root.AddAttribute("Role", SecurityElement.Escape(Role));
}
return root;
}