title: How to get xml attribute value containing multiple colons in a single tag i.e. namespaces?
body: <p>Here is my XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
    &lt;feed xml:base="XYZ" xmlns:d="http://schemas/services" xmlns:m="http://schemas/metadata" xmlns="http://www.abc.pqr/Atom"&gt;
    &lt;title type="text"&gt;Title&lt;/title&gt;
    &lt;id&gt;Id&lt;/id&gt;
    &lt;updated&gt;2018-02-08&lt;/updated&gt;
    &lt;link rel="self" title="titl" href="title" /&gt;
    &lt;entry m:etag="W/&amp;quot;25&amp;quot;"&gt;
      &lt;id&gt;id1&lt;/id&gt;
      &lt;title type="text"&gt;title_text&lt;/title&gt;
      &lt;updated&gt;2018-02-08&lt;/updated&gt;
      &lt;author&gt;
      &lt;name /&gt;
      &lt;/author&gt;
      &lt;link m:etag="&amp;quot;{acx},25&amp;quot;" rel="edit-media" title="title_value" /&gt;
      &lt;link rel="edit" title="title" /&gt;
      &lt;link rel="http://az.com/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="title/CreatedBy" /&gt;
      &lt;link rel="http://az.com/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="title/ModifiedBy" /&gt;
      &lt;link rel="http://az.com/CheckedOutTo" type="application/atom+xml;type=entry" title="CheckedOutTo" href="title/CheckedOutTo" /&gt;
      &lt;category term="xyz" scheme="xyz" /&gt;
      &lt;content type="application/octetstream" src="http://collb.xlsm" /&gt;
      &lt;m:properties xmlns:m="http://xyz/metadata" xmlns:d="wsx/dataservices"&gt;
         &lt;d:ContentTypeID&gt;contentId&lt;/d:ContentTypeID&gt;
         &lt;d:Dept&gt;21&lt;/d:Dept&gt;
         &lt;d:Class&gt;0&lt;/d:Class&gt;      
         &lt;d:Id m:type="Edm.Int32"&gt;2121&lt;/d:Id&gt;
      &lt;/m:properties&gt;
    &lt;/entry&gt;
    &lt;link rel="next" href="http://tyu.com" /&gt;
    &lt;/feed&gt;
  </code></pre>
  
  <p>I want to read values corresponding to <code>&lt;d:Id m:type&gt;</code> and <code>&lt;entry m:etag&gt;</code> i.e. output should be <code>2121</code> and <code>25</code>.</p>
  
  <p>How should I read these. </p>
  
  <p>P.S: I have gone through similar questions asked on stackoverflow, but nothing worked for me.</p>
  
  <p>Part of my code:</p>
  
  <pre><code> DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
   builderFactory.setNamespaceAware(true);
   DocumentBuilder documentBuilder = documentBuilder = builderFactory.newDocumentBuilder();
   Document doc = documentBuilder.parse(connection.getInputStream());
   Element element = doc.getDocumentElement();
   element.getAttributeNodeNS("http://schemas/metadata", "type");
  </code></pre>