question: private String addAttributeQueryTemplate ( String extended , String cot ) { String buff = "    <AttributeQueryConfig metaAlias=\"/attrQuery\">\n" + "        <Attribute name=\"signingCertAlias\">\n" + "            <Value>" + "</Value>\n" + "        </Attribute>\n" + "        <Attribute name=\"encryptionCertAlias\">\n" + "            <Value>" + "</Value>\n" + "        </Attribute>\n" + "        <Attribute name=\"wantNameIDEncrypted\">\n" + "            <Value>" + "</Value>\n" + "        </Attribute>\n" + "        <Attribute name=\"cotlist\">\n" + "            <Value>" + cot + "</Value>\n" + "        </Attribute>\n" + "    </AttributeQueryConfig>\n" ; int idx = extended . indexOf ( "</EntityConfig>" ) ; if ( idx != - 1 ) { extended = extended . substring ( 0 , idx ) + buff + "</EntityConfig>" ; } return extended ; }
target:  Below method will add the AttributeQuery to the SP extended meta data