im outputting an xml file within asp.net and am struggling to find how to output this line:-

<wsse:Password Type="http://docs.oasisopen.org/wss/2004/01/oasis200401wssusernametokenprofile1.0#PasswordText">PASSWORD</wsse:Password>

im trying this:-

objWriter.WriteElementString("wsse:Password", "PASSWORD");
objWriter.WriteAttributeString("Type", "http://docs.oasisopen.org/wss/2004/01/oasis200401wssusernametokenprofile1.0#PasswordText");

but on running i get this error:-

Token StartAttribute in state Content would result in an invalid XML document.

im guessing its cos the element string has already been created ie close tag added and wont accept the attribute.

there must be a way to do this... anyone help?