public NodeList findAttributesElements(String name) throws XPathExpressionException {
        return (NodeList) xPath.compile(
                "/xs:schema/xs:complexType[@name='" + name + "']//xs:attribute")
                .evaluate(document, XPathConstants.NODESET);
    }
@Test
    public void testFindAttributesElements() throws Exception {
        Document document = XmlHelper.buildNamespaceAwareDocument(
                ResourceUtils.getResourceAsFile("xmls/complex_type.xml"));
        XPath xPath = XmlHelper.buildXPath(new CamelSpringNamespace());
        domFinder = new DomFinder(document, xPath);

        NodeList attributesList = domFinder.findAttributesElements("interceptSendToEndpointDefinition");

        assertEquals(2, attributesList.getLength());

        assertEquals("uri", ((Element) attributesList.item(0)).getAttribute(Constants.NAME_ATTRIBUTE_NAME));
        assertEquals("skipSendToOriginalEndpoint",
                ((Element) attributesList.item(1)).getAttribute(Constants.NAME_ATTRIBUTE_NAME));
    }