@ SuppressWarnings ( "Duplicates" ) public static Element createUserDefinedSimplefield ( Document doc , String name , String value ) { Element root = XmlUtils . getRootElement ( doc ) ; Element node = doc . createElementNS ( root . getNamespaceURI ( ) , "user_defined_simplefield" ) ; node . setAttribute ( "feldname" , name ) ; node . setTextContent ( value ) ; return node ; }
Helper method to create a &lt ; user_defined_simplefield&gt ; element with a feldname attribute and a string value .