You're overwriting just created variable `header`...

`String header = (attribute.hasNamespace() ? attribute.getNamespace() + "::" : "") + attribute.getName();`