private String removeNamespace(String xml) throws Exception {
        NamespaceRemovingInputStream inputStream = new NamespaceRemovingInputStream(new ByteArrayInputStream(xml.getBytes()));
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        IOUtils.copy(inputStream, outputStream);

        return new String(outputStream.toByteArray());
    }
Test for filtering out XML namespace attributes when reading XML.
aws-java-sdk-core/src/test/java/com/amazonaws/util/NamespaceRemovingInputStreamTest.java