def _make_prefixed(self, name, is_element, declared_prefixes, declarations):
namespace, name = self._split_qname(name, is_element)<EOL>if namespace is None:<EOL><INDENT>prefix = None<EOL><DEDENT>elif namespace in declared_prefixes:<EOL><INDENT>prefix = declared_prefixes[namespace]<EOL><DEDENT>elif namespace in self._prefixes:<EOL><INDENT>prefix = self._prefixes[namespace]<EOL>declarations[namespace] = prefix<EOL>declared_prefixes[namespace] = prefix<EOL><DEDENT>else:<EOL><INDENT>if is_element:<EOL><INDENT>prefix = None<EOL><DEDENT>else:<EOL><INDENT>prefix = self._make_prefix(declared_prefixes)<EOL><DEDENT>declarations[namespace] = prefix<EOL>declared_prefixes[namespace] = prefix<EOL><DEDENT>if prefix:<EOL><INDENT>return prefix + "<STR_LIT::>" + name<EOL><DEDENT>else:<EOL><INDENT>return name<EOL><DEDENT>
Return namespace-prefixed tag or attribute name.

        Add appropriate declaration to `declarations` when neccessary.

        If no prefix for an element namespace is defined, make the elements
        namespace default (no prefix). For attributes, make up a prefix in such
        case.

        :Parameters:
            - `name`: QName ('{namespace-uri}local-name')
              to convert
            - `is_element`: `True` for element, `False` for an attribute
            - `declared_prefixes`: mapping of prefixes already declared
              at this scope
            - `declarations`: XMLNS declarations on the current element.
        :Types:
            - `name`: `unicode`
            - `is_element`: `bool`
            - `declared_prefixes`: `unicode` to `unicode` dictionary
            - `declarations`: `unicode` to `unicode` dictionary

        :Returntype: `unicode`