void () { final MyElement element = createElement("<a xmlns=\"foo\" xmlns:bar=\"bar\"><foo-child bar:my-attribute=\"xxx\"/></a>", MyElement.class); registerNamespacePolicies(element); final MyFooElement fooElement = element.getFooChild(); final MyAttribute myAttribute = fooElement.getMyAttribute(); assertNotNull(myAttribute.getXmlAttribute()); assertEquals("xxx", myAttribute.getStringValue()); }