You need to specify the android
namespace prefix on the root element of the XML document, then add the name attribute using the same namespace.
Namespace ns = Namespace.getNamespace( "android" );
Element e = new Element( "uses-permission", ns );
e.setAttribute( "name", "android.permission.INTERNET", ns );