title: ORA-19202: Error occurred in XML processing LPX-00210: expected '<' instead of 'M' Error at line 1
body: <p>I had this query working properly for years until recently where i changed another query in the collector and saved.  I didnt change this xml query at all, but now its failing on the xml part.  Im and definitely not versed well in xml so im looking for some help to see where the issue is.  Here is the error message i am receiving:</p>
  
  <blockquote>
    <p>ORA-31011: XML parsing failed ORA-19202: Error occurred in XML
    processing LPX-00210: expected '&lt;' instead of 'M' Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 0 ORA-06512: at line 1</p>
  </blockquote>
  
  <p>Here is my query that worked properly and now is not:</p>
  
  <pre><code>select Distinct trim(B.RoleID) as RoleID,
               replace(replace(extractvalue(value(C), '/item/menu') || ' &gt;' ||
               extractvalue(value(C), '/item/submenu1') || ' &gt;' ||
               extractvalue(value(C), '/item/submenu2') || ' &gt;' ||
               extractvalue(value(C), '/item/label'), ' &gt; &gt; &gt;', ' &gt;'),' &gt; &gt;', ' &gt;') as Res,
               extractvalue(value(C), '/item/name') as Action,
               extractvalue(value(C), '/item/visible') as visible
               from PLPROD_MORT.MENU A, 
               (SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Processing and Closing (Group A)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Branch Consumer (Group B)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Branch Level Input (Group C)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('DU (Group D)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Escrow Accounting (Group E)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Override Locking - PE (Group F)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Post Closing (Group G)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Servicing - Reconciliation - Loan Support (Group H)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Point of Sale Consumer (Group I)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Training (Group J)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Secondary Marketing (Group M)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Originator (Group O)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Appraisal (Group P)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Quality Control (Group Q)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Rate Lock (Group R)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Servicing (Group S)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Lock - PE (Group T)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Underwriting (Group U)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Test X Level (Group X)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Management Override (Group Y)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Test (Group Z)') AS RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('All screens and stages (No Groups)') As RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Inquiry Only (Access I)') As RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Operator (Access O)') As RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Preferred Operator (Access P)') As RoleID FROM PLPROD_MORT.MENU
               union  
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('Supervisor (Access S)') As RoleID FROM PLPROD_MORT.MENU
               union
               SELECT DISTINCT TRIM("MENUNAME") AS Menu, TRIM("MENUNAME") || ' - ' || upper('No Access') As RoleID FROM PLPROD_MORT.MENU) B,
               table
               (XMLSEQUENCE
               (extract
               (XMLTRANSFORM
               (XMLTYPE(A.MENUDATA),
                XMLTYPE('&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;&lt;xsl:output method="xml" version="1.0" omit-xml-declaration="yes"/&gt;&lt;xsl:template match="/"&gt;&lt;menus&gt;&lt;xsl:for-each select="//menu"&gt;&lt;item&gt;&lt;name&gt;Menu&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/menu&gt;&lt;submenu1/&gt;&lt;submenu2/&gt;&lt;label/&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;xsl:for-each select="//menu/item"&gt;&lt;item&gt;&lt;name&gt;Menu Item&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="../@label"/&gt;&lt;/menu&gt;&lt;submenu1/&gt;&lt;submenu2/&gt;&lt;label&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/label&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;xsl:for-each select="//menu/submenu"&gt;&lt;item&gt;&lt;name&gt;Submenu&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="../@label"/&gt;&lt;/menu&gt;&lt;submenu1&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/submenu1&gt;&lt;submenu2/&gt;&lt;label/&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;xsl:for-each select="//menu/submenu/item"&gt;&lt;item&gt;&lt;name&gt;Submenu Item&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="../../@label"/&gt;&lt;/menu&gt;&lt;submenu1&gt;&lt;xsl:value-of select="../@label"/&gt;&lt;/submenu1&gt;&lt;submenu2/&gt;&lt;label&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/label&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;xsl:for-each select="//menu/submenu/submenu"&gt;&lt;item&gt;&lt;name&gt;Submenu&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="../../@label"/&gt;&lt;/menu&gt;&lt;submenu1&gt;&lt;xsl:value-of select="../@label"/&gt;&lt;/submenu1&gt;&lt;submenu2&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/submenu2&gt;&lt;label/&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;xsl:for-each select="//menu/submenu/submenu/item"&gt;&lt;item&gt;&lt;name&gt;Submenu Item&lt;/name&gt;&lt;menu&gt;&lt;xsl:value-of select="../../../@label"/&gt;&lt;/menu&gt;&lt;submenu1&gt;&lt;xsl:value-of select="../../@label"/&gt;&lt;/submenu1&gt;&lt;submenu2&gt;&lt;xsl:value-of select="../@label"/&gt;&lt;/submenu2&gt;&lt;label&gt;&lt;xsl:value-of select="@label"/&gt;&lt;/label&gt;&lt;mnemonic&gt;&lt;xsl:value-of select="@mnemonic"/&gt;&lt;/mnemonic&gt;&lt;visible&gt;&lt;xsl:value-of select="@visible"/&gt;&lt;/visible&gt;&lt;/item&gt;&lt;/xsl:for-each&gt;&lt;/menus&gt;&lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;'))
                , '//item'))) C
                where trim(A.MENUNAME) = B.MENU and extractvalue(value(C), '/item/visible') = 'true'
  </code></pre>