我有一个 xml,我如何构造该类,以便在序列化它时,它看起来像这样。
<Security xmlns="http://docs.oasis-open.org/x/xxxxx.xsd"  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    <saml:Assertion ID="xxxxx" IssueInstant="xxxxxxx" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
        <saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified">MyApp</saml:Issuer>
        <saml:Subject>
            <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified">MyApp</saml:NameID>
        </saml:Subject>
        <saml:AttributeStatement>
            <saml:Attribute Name="UserID" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
                <saml:AttributeValue>TestUserID</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="UserFirstName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
                <saml:AttributeValue>TestUserFirstName</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="UserLastName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
                <saml:AttributeValue>TestUserLastName</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="ReasonForSearch" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
                <saml:AttributeValue>ReasonForSearch</saml:AttributeValue>
            </saml:Attribute>
        </saml:AttributeStatement>
    </saml:Assertion>
</Security>