Set namespace using jdom
问题 I would like have this format in xml: <ns2: test xmlns="url" xmlns:ns2="url2" xmlns:ns3="url3"> .... </ns2: test> I am using the following code: Namespace ns= Namespace.getNamespace("url"); Namespace ns2 = Namespace.getNamespace("ns2", "url2"); Namespace ns3= Namespace.getNamespace("ns3", "url3"); SAXBuilder vDocBuilder = new SAXBuilder(); Document vDocument = vDocBuilder.build(File); System.out.println("Root element " + vDocument.getRootElement().getName()); org.jdom.Element test = new org